[Support request] nested shortcodes in header element

Home Forums Support [Support request] nested shortcodes in header element

Home Forums Support nested shortcodes in header element

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2012449
    drew

    I’m using the recommended snippet to insert a page excerpt into a header element and it works fine except when I need to use a column shortcode via Tom’s lightweight grid column plugin. It seems that nested shortcodes aren’t working so is there a version of the snippet at https://docs.generatepress.com/article/page-hero-examples/#example-4 that will allow it to work as a nested shortcode?

    #2012497
    Leo
    Staff
    Customer Support

    Hi there,

    That method is old.

    I would recommend using a block element page hero;
    https://docs.generatepress.com/article/block-element-page-hero/

    Then you can use GP’s dynamic block:
    https://docs.generatepress.com/article/dynamic-blocks/#post-excerpt

    Then you can avoid LGC and use the grid block from GB as well:
    https://docs.generateblocks.com/article/grid-overview/

    We don’t recommend using LGC anymore – it’s a very ourdated method.

    #2012534
    drew

    Thanks Leo, I’m not using blocks, they aren’t WCAG compliant and without any sort of converter for the hundreds of instances of header elements in place now, being forced into them at this point isn’t an option. Consequently, how do I get the nested shortcodes working here?

    I’ve mentioned the desperate need for the migration/converter tool to Tom on a few occasions now but never hear back about any progress or a road map. Without it, GP is asking devs to migrate all of their client designs manually. I took the time to calculate how many work hours it would require and I’m looking at more than $6,000 in labor alone with all the client sites we manage. then we have to add all the variables of building out the changes in a dev environment and adding even more time to include client sales records etc. that rolled in during the migration period. It’s a serious clusterfoxtrot without a tool to handle these migrations so devs aren’t expected to ostensibly rebuild each and every one of their sites from scratch.

    So please, I would be grateful if we could get LGC working with nested shortcodes.

    #2012735
    Tom
    Lead Developer
    Lead Developer

    Hey Drew,

    If it were me, I would just use custom HTML with some simple flexbox CSS to create columns instead of using shortcodes.

    However, if you want to use LGC, you’ll have to edit the main plugin file so it accepts shortcodes.

    You’d replace this line: https://github.com/tomusborne/lightweight-grid-columns/blob/master/lightweight-grid-columns.php#L151

    With this: return force_balance_tags( do_shortcode( $content ) );

    That should allow for shortcode nesting.

    Let us know πŸ™‚

    #2013453
    drew

    Hi Tom, you are absolutely correct, we could handle that with either some HTML or adding a CSS class. I was hoping we could keep things more efficient by using the tools we have in place already and clients are comfortable using when they need to make content changes.

    Thanks for the code modification.

    Have you folks had the bandwidth to take a closer look at the section migration function?

    #2013866
    Tom
    Lead Developer
    Lead Developer

    Haven’t had the opportunity to look at it yet, unfortunately. We’ve had some pretty major things in development (GP 3.1, upcoming GB version).

    It’s still on our roadmap πŸ™‚

    #2013934
    drew

    Many thanks and I sincerely appreciate the update.

    #2016712
    Tom
    Lead Developer
    Lead Developer

    No problem! πŸ™‚

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