Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Add media to modular page

Started by Muut Archive 9 years ago · 2 replies · 431 views
9 years ago

So i have a modular page called about which is divided into several modular sections: introduction_, _team, ... Now introduction_ is a basic page with content (markdown editor) and pagemedia (file uploader). But when I add the file to the markdown editor the generated link is wrong and is pointing to /about/filename instead of /about/_introduction/filename is there any solution to this? I really need the flexibility to add links to pdf's, word files and even images.

9 years ago

It should link to /about/_introduction/filename really. I just checked.

Can you try disabling the pages cache for a bit? As the modular content is cached, you might be seeing strange results when developing the site.

9 years ago

Hmm maybe it's because I created a custom blueprint that does not inherit from the default? Besides that I also ran into a second problem where you can only create one pagemedia type field so I had to change it to a file type which doesn't support drag and drop to the editor. I added the blueprint config below if you have any solution to this that would be great! Thanks in advance!

YAML

# mytheme/blueprints/modular/two_column.yaml
title: Two Column

form:
  validation: loose

  fields:
    tabs:
      type: tabs
      active: 1

      fields:
        left_column:
          type: tab
          title: Left

          fields:
            header.title_left: 
              type: text
              label: Left Column
              placeholder: title
              style: vertical
            header.subtitle_left:
              type: text
              placeholder: subtitle
              style: vertical
            header.content_left:
              type: editor
              style: vertical
            header.uploads_left:
              type: file
              label: Media
              multiple: true
              destination: 'self@'
              style: vertical

        right_column:
          type: tab
          title: Right

          fields:
            header.title_right:
              type: text
              label: Right Column
              placeholder: title
              style: vertical
            header.subtitle_right:
              type: text
              placeholder: subtitle
              style: vertical
            header.content_right:
              type: editor
              style: vertical
            header.uploads_right:
              type: file
              label: Media
              multiple: true
              destination: 'self@'
              style: vertical
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1346 9 years ago
Archive · by Muut Archive, 9 years ago
2 933 9 years ago
Archive · by Muut Archive, 9 years ago
2 4060 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago