[TYPO3-english] Clickable glyphicon - typoscript menu
Jigal van Hemert
jigal.van.hemert at typo3.org
Thu Jul 7 11:31:17 CEST 2016
Hi,
On 07/07/2016 11:06, Tom Warwick wrote:
> I've created a typoscript menu that inserts a unique glyph icon followed
> by a page title for every item in my menu.
>
> NO.allWrap = <li><span class="glyphicons
> glyphicons-{field:uid}"></span><span class="text-center">|</span></li>
>
> What I'd like to do is make the glyphicon clickable aswell, but I'm
> unsure how to wrap both items in a single a-tag.
There are plenty of wraps and options available:
allWrap: wraps the whole item (the link and the linkWrap)
linkWrap: wraps the link itself
ATagBeforeWrap: modifies .linkWrap: the link text is first wrapped with
.linkWrap and then with the A-tag
stdWrap: all stdWrap properties available to apply to the link-text
This could lead to several solutions:
NO {
allWrap = <li>|</li>
linkWrap = <span class="glyphicons
glyphicons-{field:uid}"></span><span class="text-center">|</span>
ATagBeforeWrap = 1
}
or
NO {
allWrap = <li>|</li>
stdWrap.wrap = <span class="glyphicons
glyphicons-{field:uid}"></span><span class="text-center">|</span>
}
Note: for a lot of menu's with a submenu the submenu should be put
inside the <li> of the parent level. This can be done by using
wrapItemAndSub instead of allWrap.
https://docs.typo3.org/typo3cms/TyposcriptReference/MenuObjects/Tmenuitem/Index.html
--
Jigal van Hemert
TYPO3 CMS Active Contributor
TYPO3 .... inspiring people to share!
Get involved: typo3.org
More information about the TYPO3-english
mailing list