|
|||||||
| Registrieren | Hilfe | Benutzerliste | Kalender | Suchen | Heutige Beiträge | Alle Foren als gelesen markieren |
|
#1
|
|||
|
|||
|
Hello,
In my template I have a naviagtion menu made out of an UL and LI elements. // *** START CODE *** <ul id="utilities"> <li class="topMenu_unselected"><a href="#">Item 1</a></li> <li class="topMenu_unselected"><a href="#">Item 2</a></li> <li class="topMenu_unselected"><a href="#">Item 3</a></li> <li class="topMenu_unselected"><a href="#">Item 4</a></li> <li class="topMenu_unselected"><a href="#">Item 5</a></li> </ul> // *** END CODE *** After about FOUR hours of going through the tutorials I managed to actually get the dummy navigation text replaced with the names of the pages I want in the navigation bar. Here's the code in the setup part of the template // *** START CODE *** # Configuring the Auto-Parser for main template: plugin.tx_automaketemplate_pi1 { # Read the template file: content = FILE content.file = fileadmin/templates/metrinomics/metrinomics_core.html # Here we define which elements in the HTML that # should be wrapped in subpart-comments: elements { BODY.all = 1 BODY.all.subpartMarker = DOCUMENT_BODY HEAD.all = 1 HEAD.all.subpartMarker = DOCUMENT_HEADER HEAD.rmTagSections = title LI.all = 1 } # Prefix all relative paths with this value: relPathPrefix = fileadmin/templates/metrinomics/ } # Menu 1 cObject temp.menuTop = HMENU temp.menuTop.maxItems = 5 # First level menu-object, textual temp.menuTop.1 = TMENU temp.menuTop.1 { # Normal state properties NO.allWrap = <li class="topMenu_unselected"> | </li> # Enable active state and set properties: ACT = 1 ACT.allWrap = <li class="topMenu_selected"> | </li> } # Main TEMPLATE cObject for the BODY temp.mainTemplate = TEMPLATE temp.mainTemplate { # Feeding the content from the Auto-parser to the TEMPLATE cObject: template =< plugin.tx_automaketemplate_pi1 # Select only the content between the <body>-tags workOnSubpart = DOCUMENT_BODY # Substitute the ###menu_1### subpart with some example content: subparts.utilities < temp.menuTop # Substitute the ###content### subpart with some example content: subparts.content = TEXT subparts.content.value = HELLO WORLD - CONTENT } # Main TEMPLATE cObject for the HEAD temp.headTemplate = TEMPLATE temp.headTemplate { # Feeding the content from the Auto-parser to the TEMPLATE cObject: template =< plugin.tx_automaketemplate_pi1 # Select only the content between the <head>-tags workOnSubpart = DOCUMENT_HEADER } # Default PAGE object: page = PAGE page.typeNum = 0 # Copying the content from TEMPLATE for <body>-section: page.10 < temp.mainTemplate # Copying the content from TEMPLATE for <head>-section: page.headerData.10 < temp.headTemplate // *** END CODE *** This is what the menu is rendered as: | Unternehmen | Jobs | News | Suche | Kontakt | There are two problems with this: 1: I don' want the | at the start or the end, just in between the items 2: The actual order of the pages is Kontakt Suche News Jobs Unternehmen TYPO3 seems to have reversed the order of the pages. How can I correct this? Why has it done this? _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#2
|
|||
|
|||
|
Ok,
I've since discouvered that the | appearing were created in the CSS. Now my menu appears but without a spacer. How do I add a spacer? Also I still need help with why the page order is reversed. -----Ursprungliche Nachricht----- Von: typo3-english-bounces (AT) lists (DOT) netfielders.de [mailto:typo3-english-bounces (AT) lists (DOT) netfielders.de]Im Auftrag von Stephen Bungert Gesendet: Freitag, 12. Oktober 2007 14:30 An: typo3-english (AT) lists (DOT) netfielders.de Betreff: [TYPO3] Help understanding TYPO3 Hello, In my template I have a naviagtion menu made out of an UL and LI elements. // *** START CODE *** <ul id="utilities"> <li class="topMenu_unselected"><a href="#">Item 1</a></li> <li class="topMenu_unselected"><a href="#">Item 2</a></li> <li class="topMenu_unselected"><a href="#">Item 3</a></li> <li class="topMenu_unselected"><a href="#">Item 4</a></li> <li class="topMenu_unselected"><a href="#">Item 5</a></li> </ul> // *** END CODE *** After about FOUR hours of going through the tutorials I managed to actually get the dummy navigation text replaced with the names of the pages I want in the navigation bar. Here's the code in the setup part of the template // *** START CODE *** # Configuring the Auto-Parser for main template: plugin.tx_automaketemplate_pi1 { # Read the template file: content = FILE content.file = fileadmin/templates/metrinomics/metrinomics_core.html # Here we define which elements in the HTML that # should be wrapped in subpart-comments: elements { BODY.all = 1 BODY.all.subpartMarker = DOCUMENT_BODY HEAD.all = 1 HEAD.all.subpartMarker = DOCUMENT_HEADER HEAD.rmTagSections = title LI.all = 1 } # Prefix all relative paths with this value: relPathPrefix = fileadmin/templates/metrinomics/ } # Menu 1 cObject temp.menuTop = HMENU temp.menuTop.maxItems = 5 # First level menu-object, textual temp.menuTop.1 = TMENU temp.menuTop.1 { # Normal state properties NO.allWrap = <li class="topMenu_unselected"> | </li> # Enable active state and set properties: ACT = 1 ACT.allWrap = <li class="topMenu_selected"> | </li> } # Main TEMPLATE cObject for the BODY temp.mainTemplate = TEMPLATE temp.mainTemplate { # Feeding the content from the Auto-parser to the TEMPLATE cObject: template =< plugin.tx_automaketemplate_pi1 # Select only the content between the <body>-tags workOnSubpart = DOCUMENT_BODY # Substitute the ###menu_1### subpart with some example content: subparts.utilities < temp.menuTop # Substitute the ###content### subpart with some example content: subparts.content = TEXT subparts.content.value = HELLO WORLD - CONTENT } # Main TEMPLATE cObject for the HEAD temp.headTemplate = TEMPLATE temp.headTemplate { # Feeding the content from the Auto-parser to the TEMPLATE cObject: template =< plugin.tx_automaketemplate_pi1 # Select only the content between the <head>-tags workOnSubpart = DOCUMENT_HEADER } # Default PAGE object: page = PAGE page.typeNum = 0 # Copying the content from TEMPLATE for <body>-section: page.10 < temp.mainTemplate # Copying the content from TEMPLATE for <head>-section: page.headerData.10 < temp.headTemplate // *** END CODE *** This is what the menu is rendered as: | Unternehmen | Jobs | News | Suche | Kontakt | There are two problems with this: 1: I don' want the | at the start or the end, just in between the items 2: The actual order of the pages is Kontakt Suche News Jobs Unternehmen TYPO3 seems to have reversed the order of the pages. How can I correct this? Why has it done this? _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#3
|
|||
|
|||
|
> 2: The actual order of the pages is
> > Kontakt > Suche > News > Jobs > Unternehmen > > TYPO3 seems to have reversed the order of the pages. How can I correct this? > Why has it done this? Let me guess: all your list items have a CSS attribute "float:right". Check the source code and I bet that "Kontakt" is the first list item. You can either set "float:left" or, if not possible for design reasons, actually DO make TYPO3 to generate the menu in reverse order: temp.menuTop.1.alternativeSortingField = sorting DESC Tomas Mrozek _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
|
#4
|
|||
|
|||
|
> # Normal state properties
> NO.allWrap = <li class="topMenu_unselected"> | </li> > > # Enable active state and set properties: > ACT = 1 > ACT.allWrap = <li class="topMenu_selected"> | </li> > > This is what the menu is rendered as: > >> Unternehmen | Jobs | News | Suche | Kontakt | > > There are two problems with this: > > 1: I don' want the | at the start or the end, just in between the > items This is a job for optionSplit: http://typo3.org/documentation/docum...3/1/#id3520928 According to the TSref you should change your code to look like this: # Normal state properties NO.allWrap = <li> | </li>|*||*|<li class="last"> | </li> # Enable active state and set properties: ACT = 1 ACT.allWrap = <li class="act"> | </li>|*||*|<li class="act_last"> | </li> you don't need the "topMenu" in the class of the <li> since you could use <ul class="topMenu"> and then do a proper cascading. HTH Joey _______________________________________________ TYPO3-english mailing list TYPO3-english (AT) lists (DOT) netfielders.de http://lists.netfielders.de/cgi-bin/.../typo3-english |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | Thema bewerten |
|
|
|
||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| [TYPO3] help with understanding how pi1 class php files relate tothe database | dave typo | typo3-english@lists.netfielders.de | 0 | 29.05.2007 17:36 |
| [TYPO3-dev] Understanding ext_tables.php | Fr. Simon Rundell SCP | typo3-dev@lists.netfielders.de | 1 | 23.05.2007 10:35 |