• Resolved krpfeiffer

    (@krpfeiffer)


    Is it possible to generate anchor links (id tags) and add additional CSS classes to template blocks? This would be like the normal block editor advanced tag which allows HTML anchor and additional CSS classes. My use case is a post-level table of contents, with links to instruction groups, for example. The toc is generated by a js script using element id tags.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Brecht

    (@brechtvds)

    We don’t have the ability to add IDs to our shortcodes at the moment, but in the Template Editor you could surround the shortcode with a div or span that has the ID you want to jump to.

    That won’t work for instruction groups, but if you’re using custom JS code you could loop over the wprm-recipe-instruction-group-name class to dynamically add an ID to those.

    Thread Starter krpfeiffer

    (@krpfeiffer)

    Thank you for the really rapid response.

    Trying to avoid too much js – nicer if it came from the backend already done, but (sigh), it is what it is. A backlog item, perhaps? I’ll do the wrapper method, which will give me at least ingredients, instructions equipment, notes, etc.

    Love the plugin. I gave a max rating years ago and see no reason to change that.

    Plugin Author Brecht

    (@brechtvds)

    Happy to hear you’re still enjoying the plugin!

    I can add it to the idea list, but there are other priorities right now, I’m afraid.

    We also have plugin hooks available that would allow you to alter the output yourself:
    https://help.bootstrapped.ventures/article/129-plugin-hooks-and-filters

    Thread Starter krpfeiffer

    (@krpfeiffer)

    Thanks Brecht. My bad. I should have looked at the hooks first, then I wouldn’t have bothered you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘anchor links and additional classes’ is closed to new replies.