[Support request] Elements – Blocks Priority

Home Forums Support [Support request] Elements – Blocks Priority

Home Forums Support Elements – Blocks Priority

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #1619647
    Fabien

    Hi,

    When using a Block Element, is there a way to add a priority (like you can do with hooks) ?

    Thanks

    #1619650
    Fabien

    Just to clarify, I am talking about a (Right) Sidebar block type

    #1619860
    David
    Staff
    Customer Support

    Hi there,

    Priorities will only apply if you use a Hook – you can can use the before_ or after_right_sidebar_content to hook into the same place.

    The alternative when replacing the Sidebar, is to create the complete Sidebar for page X and then create a complete alternative for page Y

    #1619885
    Fabien

    I guess I’ve found a “hack”, switch to “hook” change priority, go back to “right sidebar” !

    #1620118
    David
    Staff
    Customer Support

    Well wouldn’t you know 🙂
    I’ll let Tom know.

    #2168620
    Natalie

    I was looking for the way to change the order of my 4 seperate right sidebar elements.
    I could not find anything in the documentation. I saw that other Element Types have the Priority item but Right Sidebar does not.

    The “Hack” Fabien suggests works, Thanks for that.

    Surely Priority should be an option under the Right Sidebar Elemet Type.

    #2168921
    David
    Staff
    Customer Support

    Hmmm… it was never in our consideration that a user may want to add many Right Sidebars to the page, that is where the before and after sidebar hooks should be used.

    Ill take a look whether we can adding priority for the sidebar option itself is a possibility.

    #2291277
    Scott

    If I’m not mistaken, every one of those GP Element types gets inserted in the appropriate place via a hook, and all hooks have a priority (with a default of 10 if not specified), so it would seem that exposing that priority would make a lot of sense. Since you can cause multiple GP Elements to fire off for a page, you would expect you would be able to control the order when they all hang off a common hook, like after-main-content. Using a different hook to attach to a different part of the page doesn’t make sense; you would expect to be able to write these hooks/blocks independently from each other.

    #2291541
    David
    Staff
    Customer Support

    Yeah, its on our list of to dos, hopefully with the next elements update.
    For the record, the priority is only missing from the specific block element types that are used to replace a theme template part such as the Right or Left Sidebar. The Priority is available for the Element Type > Hook.

    #2292340
    Scott

    …but not Blocks, which is where it’s really needed. Thanks for keeping the issue visible!

    #2292750
    David
    Staff
    Customer Support

    FYI – If the Block Element is set to Element Type: Hook then the priority is there:

    https://docs.generatepress.com/article/block-element-hook/

    Glad to be of help

    #2293193
    Scott

    Hmm, I don’t think it works that way anymore… When I create an Element, I choose type Block, because if I choose type Hook the editor I’m given is a code editor, not a Block editor. In that case, I’m not presented with the metabox containing the hook priority as is shown in the article.

    That’s how I _wish_ it would work, but I do not think the current version does it that way. I’d love to be proven wrong, though!

    #2293195
    David
    Staff
    Customer Support

    Nothing has changed in the latest version, as long as the Element Type = Hook you should see this:

    2022-07-25_16-33-46

    Are you seeing something different ?

    #2293542
    Scott

    When I select Element type Hook, I see what you see, but I don’t get the block editor then, I get a code/text editor. When I select type Block, I get the Block editor, but not the hook metabox. So yes, I can make the hook metabox appear, but then I can’t edit blocks.

    #2293547
    Fernando
    Customer Support

    Hi Scott,

    May we know what you’re trying to do?

    The Hook Element and the Block Element are two different features.

    Hook Element: https://docs.generatepress.com/article/hooks-element-overview/

    Block Element: https://docs.generatepress.com/article/block-element-overview/

    If you’re wanting to use a Block Element – Hook, you’ll need to select Block as the Element type when creating a new element. Then, once in the Block Element edit page, in the Element type in the Element settings, select Hook.

    Hope this clarifies!

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