sebkln / content_slug

Adds a slug field for human-readable anchors ("domain.com/page/#my-section") to TYPO3 content elements. By default, this anchor is rendered as the header's id attribute.
GNU General Public License v2.0
11 stars 5 forks source link

[Feature Request] render anchor on type 'Hidden' #20

Open bh-teufels opened 1 year ago

bh-teufels commented 1 year ago

is it possible to also render anchor if tx_content_slug_link is active on Header type 'hidden' This means that anchors can also be used for areas that do not have a headline

sebkln commented 1 year ago

In general, the extension was created to support these anchors primarily in menu content elements like "Section index" (menu_section). As a side note: Admittedly, this menu – by TYPO3 defaults – also renders content elements with header type "Hidden". I don't consider this to be a reasonable behavior, though. If an editor sets a header to be hidden, he will expect this to be applied in all places.

One should keep the content element's uid as id attribute in the wrapping div (id="c123") at least as a fallback. This means you need a second id attribute for the human-readable anchor in each content element. The obvious choice was the heading itself, which also came with SEO advantages (link targets in SERPs).

Therefore, I'm curious about your use case. How do you plan to link to areas without a heading? Where does the link text come from, if not from the header field?

bh-teufels commented 1 year ago

i use container_elements sections and want to linkt to these section, some of them has no header or not at the top baad for SEO i know

the plan is to use Header with 'hidden' so the anchor-target can place wherever you want link text can come from this header field. But i don't use menu_section rather using Link wizard in RTE

sebkln commented 1 year ago

I will look into it, but I'm pretty busy the next weeks.