Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagemediaselect not working in element field #2421

Open
RayburnD opened this issue Sep 4, 2024 · 0 comments
Open

Pagemediaselect not working in element field #2421

RayburnD opened this issue Sep 4, 2024 · 0 comments

Comments

@RayburnD
Copy link

RayburnD commented Sep 4, 2024

I have added an elements field to my page template, but I cannot seem to use pagemediaselect as an element field. When I click the dropdown to select a media item, a red banner appears at the top of the screen that says Not Found, and nothing loads in the dropdown. The pagemediaselect works fine if it is not in an element field. Is this a bug?

I am using the latest version of Grav and Grav Admin. To reproduce, create a page template with the below YAML file.

Here is the YAML for my template. I've also attached it because for some reason the code won't format properly using the code tags in the editor.

Attachment: simple.yaml.txt

title: position
'@extends':
type: default
context: blueprints://pages

form:
fields:
tabs:
type: tabs
active: 1

  fields:
    content:
      fields:
        content:
          type: tinymce
          label: Content
          validate:
            type: textarea
        header.rightPane:
          name: rightpane
          type: tinymce
          label: Right Pane
        header.media_order:
          type: pagemedia
          label: PLUGIN_ADMIN.PAGE_MEDIA
        header.sideLinks:
          name: sideLinks
          type: list
          soft: yes
          style: vertical
          label: Links
          fields:
            .linktype:
              type: elements
              label: Link Type
              classes: fancy
              default: page
              options:
                page: Page
                externalLink: External Link
                media: Media Upload
              fields:
                .page:
                   type: element
                   fields:
                      .title:
                         name: title
                         type: text
                         label: Title
                      .page:
                         name: page
                         type: pages
                         label: Page
                .externalLink:
                   type: element
                   fields:
                      .title:
                         name: title
                         type: text
                         label: Title
                      .link:
                        name: link
                        type: text
                        label: External Link
                .media:
                   type: element
                   fields:
                      .title:
                         name: title
                         type: text
                         label: Title
                      .mediaselect:
                         name: mediaselect
                         type: pagemediaselect
                         label: Media Upload
            .order:
              type: hidden
              default: 1
        header.linkPlacement:
          type: toggle
          highlight: 1
          size: large
          classes: fancy
          label: Link Placement
          default: "side"
          options:
            "side": On the left side
            "bottom": On the bottom
        header.enableRightPane:
          type: toggle
          highlight: 1
          size: large
          classes: fancy
          label: Enable Right Pane
          default: "yes"
          options:
            "yes": Yes
            "no": No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant