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

Bing Du du_bing at hotmail.com
Wed Jun 8 19:55:47 CEST 2005


JoH wrote:

>>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
> 

THANKS SO MUCH for the clear explanation!  Now I've achieved what I 
wanted.  I've seen a lot examples showing how to create menus either 
table based or list based.  But I wanted something mixed as shown below:

Resourses
   Labtops
      > one
      > two
      > three
Vendors
   IBM
   APPLE
   DELL

First and second level menu always show.  First level just static titles 
(not clickable).  Only clicking the second level menu can the third 
level show up.  So I make table cell of the second level menu to be a list.

It works but I sure open to any better ways to do this.

Bing



More information about the TYPO3-english mailing list