[Support request] Disabling Element using page editor metabox

Home Forums Support [Support request] Disabling Element using page editor metabox

Home Forums Support Disabling Element using page editor metabox

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #979423
    Steven

    Is there a way to mark an Element so it can be added to the list of available Elements which can be disabled in the Layouts metabox in the block editor? If not, it would be great to see this as a setting for each Element. I also haven’t found a way to set which elements are disabled by default in the layout metabox in the block editor for pages. Thanks for any info you can pass along.

    #979447
    Leo
    Staff
    Customer Support

    Hi there,

    Is there a way to mark an Element so it can be added to the list of available Elements which can be disabled in the Layouts metabox in the block editor

    That’s not possible unfortunately.

    I also haven’t found a way to set which elements are disabled by default in the layout metabox in the block editor for pages.

    Not exactly sure what you are trying to achieve here but sometimes a filter solution might work:
    https://docs.generatepress.com/article/generate_header_element_display/
    https://docs.generatepress.com/article/generate_hook_element_display/
    https://docs.generatepress.com/article/generate_layout_element_display/

    You can see lots of examples if you search the filter name in our forum.

    Let me know if this helps at all 🙂

    #980053
    Steven

    I was looking for a way to allow our page editors to choose if a custom Element we created was displayed on a page-by-page basis. And then in the theme settings specify which are selected by default for the Layout > Disable Elements in the page editor. That way we can control what most pages will be set for, but still allow the editors to override that for specific pages without giving them permission to make changes to the theme settings and defaults for all pages.

    One use case is where we would like to create a custom hero header element that uses the feature image automatically. By default, we’d like that displayed on most pages. But there may be some pages where the editor would like to suppress that hero. With thousands of pages on our site, having a site admin add a display rule exception for each page will be unwieldy.

    #980077
    David
    Staff
    Customer Support

    Hi there,

    my current workaround to this issue is to use specific categories to make these types of page specific changes.
    For example – Category: No Featured Image set as exclusion in my elements.

    Then use a filter to remove these links from being displayed on the front end.

    Just an alternative – but probably best to see what Tom comes back with on some of the related topics.

    #980100
    Steven

    I believe we’re currently using categories for pages to support our Media Library folders plugin. So I think it wouldn’t work on a page-by-page basis unless I’m missing something. Thanks for sharing your idea.

    #980123
    David
    Staff
    Customer Support

    If that was a problem, you could register a custom taxonomy and use that in your display rules.

    #980178
    Steven

    That could work, but it wouldn’t be an ideal user experience. Some elements would be disabled using the Layout metabox and then others would be disabled using the custom taxonomy category.

    #980207
    David
    Staff
    Customer Support

    It would be no different to Disabling an Element using the Layout Metabox.
    Page level controls seem awfully convenient at the time of adding a page or a post. But becomes a nightmare when X pages later you need to change them to something different.

    Method using custom taxonomies:

    Lets say we have the following elements set to display on all posts:

    1. Header Element
    2. Layout Element – for removing sidebar and reducing content width.

    I register a Custom Taxonomy named e.g Layout Features. And add:
    No Hero
    Sidebar Layout

    Now i can Exlcude that taxonomy in my Element Display Rules.

    This gives me future proofing – lets say 100 posts later i no longer need the No Hero as fallback images have been accepted i can remove the exclude rule and delete my custom taxonomy tag.

    #982407
    Steven

    Thanks for the background on the potential workaround.

    I’m going to put a pin in this request for now. After digging in to the hero feature in GeneratePress, I’m unsure it’s going to work for us. It doesn’t currently support selecting the thumbnail rendition used for desktop and mobile – so the entire original is used as the background. Also, there’s no way to set the focal point on an image-by-image basis. This could be solved using the Theia Thumbnail Images plugin and a hero feature that supports specifying thumbnail renditions. There’s already a topic open for the hero thumbnail renditions request.

    #982441
    David
    Staff
    Customer Support

    You’re welcome.

    And thanks for the input, ideas and feedback.

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.