very simple question. It seems to me that all the headers (doesn’t matter if # Header1m, ## Heaader2, …) don’t have an automatic anchor in html code. I don’t know if this is the expected behavior…
To refer to a specific subsection from one page to another I have to set a named anchor and then I can call it:
## My title <a id="my-title"></a>
Have a look at [my title page](page1#my-title)
Am I missing something?
Cheers and thanks
Hi @ghtmtt, I think that the Anchors Plugin might be just what you are looking for🙂 https://github.com/getgrav/grav-plugin-anchors
Hi @paulhibbitts thanks for the answer
I tried the plugin and it seems working without having to add anything great! Maybe I’m blind, but maybe adding a mention to the plugin here https://learn.getgrav.org/15/content/markdown#named-anchors is a good idea.
wait I’m facing maybe a small issue… I want to disable the anchors on the home page (modular structure). I’ve put in all files of the home page modular structure
but still the anchors are showing in all the
o2_highlights… files in all the languages. It is a little bit annoying. Imagine the demo site here http://demo.hibbittsdesign.org/grav-open-publishing-quark/ and see the anchors where
My Open Publishing Space title appears…
are there any workaround for that?
Cheers and thanks again!
Glad the Anchors Plugin is of help! A few ideas - make sure you clear the cache while testing (or even better turn off both caches while developing the theme) in system.yaml file, and also I’d try out the
selectors option to see if you can get the result you want: https://github.com/getgrav/grav-plugin-anchors#configuration
I have only used the Anchors Plugin a bit myself.
Hi Paul… cache cleared completely, same results… using selector configuration. It is working but too much I mean: the titles overlapping the image are h1, h2 and h3 I can remove them from the selector, but (the plugin is working well) also all the other anchors from all the other pages disappear… and that’s not what I’d like to happen…
strange that the plugin configuration is not working by excluding the anchors from some pages…
Hi @ghtmtt, did you disable Active on the Plugin settings page?
If I do that all the anchors disappear right?
OK disabled the plugin configuration, enabled in another page with
but anchors are not visible…
Hi Paul… tried with only
enabled or both (of course set to false). But nothing.
Actually the way around is working: disabling the plugin from the configuration page and enable the anchors in all the pages. Do you think it is a bug and I should file a ticket?
Thanks for the reply and support!
Hi @ghtmtt, happy to help out🙂
I just tested the Anchors Plugin and to disable the plugin (i.e. Anchors) on a single page this worked:
Note that to then have Anchors displayed on a page you need this:
Are you getting a different result with those settings?
Nope that’s also what I have. I’m just wondering why it isn’t working in the other direction, like:
Without having to add
on all the other pages. Anyway, it is working
Thanks again for the information and testing