[Typo3] why <A> tag shows up twice?

JoH info at cybercraft.de
Wed Jun 8 19:16:39 CEST 2005


> Typo3 generated the following HTML for the second level menu item:
>
> <a href="index.php?id=8" onfocus="blurLink(this);" onclick="return
> toggleSubmenu(this);"><a href="index.php?id=8"
> onfocus="blurLink(this);">Overview</a></a>
>
> This is how the second level defined.
> ====================
>      before.data = field:uid
>      beforeWrap = <li><a href="index.php?id=|"
> onfocus="blurLink(this);" onclick="return toggleSubmenu(this);">
>      stdWrap.field = title
>      stdWrap.wrap = |</a>
>      after.field = uid
>      afterWrap = <ul style="display:none;" id="page|">
>      wrapItemAndSub = |<li></li></ul></li>
> ==================
> What was done wrong in temp.nav.2 that caused the duplicate <a
> href="index.php?id=8" onfocus="blurLink(this);">?

Nothing wrong here - everything works as expected.

HMENU -> TMENU -> NO generates a link wrapped in a-tags by default.
The link is created using the part "stdWrap.field = title" making it a link
to the uid of the page showing the title to click on.
Now you told this NO-item to have a before part and an after part. These are
alway _added_ to the original link part, despite you did something like
"doNotLinkIt = 1".

I guess you simply wanted to insert your onclick and onfocus parameters into
the a-tag and you don't need the before part for that. It's done with

ATagParams = onclick="return toggleSubmenu(this)";

Have a look at TSref -> TMENUITEM
http://typo3.org/documentation/document-library/doc_core_tsref/TMENUITEM/

And I am not sure if the things you do with the after part can't be solved
in a more comfortable way, by using wrapItemAndSub for the item together
with the wrap-property of the TMENU itself.
Could you provide an example HTML code to show what you want to do?

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





More information about the TYPO3-english mailing list