[TYPO3-english] redirection to subpage

StephenBungert stephenbungert at yahoo.de
Thu Feb 12 21:42:54 CET 2009


I haven't tested it, I think the TS is ok.

I don't use TemplaVoila, so I use the auto parser to mark tags. Then I would
make the menu as a seperate temp object, then add that to temp.mainTemplate.
The menu will show all the pages that are under it, if you are on one of
those sub-pages then a link to home will be placed at the beginning of the
menu. It's hard coded so not a great solution. There are other ways of doing
it that are more dynamic. This is just one of many possible ways, but will
give you an idea of what is possible. You should work through the tutorials
and read terf a bit.

plugin.tx_automaketemplate_pi1 {

  # FILL IN with correct path and file name
  # Read the template file:
  content = FILE
  content.file = path/to/template.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
    
    # Remove title tag
    HEAD.rmTagSections = title
    
    # CHANGE topMenu TO MATCH THE ID OF YOUR UL/DIV, OR WHATEVER
    UL.id.topMenu = 1
    
    # COULD BE A CLASS TOO, LIKE THIS:
    # UL.class.topMenu = 1
  }

  # FILL IN with correct path
  # Prefix all relative paths with this value:
  relPathPrefix = 
}



temp.menu_top = HMENU
temp.menu_top {
  1 = TMENU
  1 {
    NO = 1
    NO {
      stdWrap {
        htmlSpecialChars = 1
      }
      allWrap = <li>|</li>
    }
    
    # Copy NO to CUR
    CUR < .NO
    CUR.allWrap = <li id="current">|</li>
    
    ACT < .CUR
    ACT.allWrap = <li id="active">|</li>
  }
}



# CHANGE 1 TO THE MAIN PAGE/NEW HOME PAGE ID IF NOT 1
[PIDupinRootline = 1]
# Remove begin property
temp.menu_top.1.wrap = <li> index.php?id=1 Home </li>|
[global]



temp.mainTemplate = TEMPLATE
temp.mainTemplate {
  template =< plugin.tx_automaketemplate_pi1
  workOnSubpart = DOCUMENT_BODY
  subparts.content < styles.content.get
  
  # Change topMenu to whatever you called the tag in
plugin.tx_automaketemplate_pi1.elements
  subparts.topMenu < temp.menu_top
}

-----
-- 
Stephen Bungert
-- 
View this message in context: http://www.nabble.com/-TYPO3-english---redirection-to-subpage-tp21977446p21984586.html
Sent from the TYPO3 English mailing list archive at Nabble.com.



More information about the TYPO3-english mailing list