chetan.g
chetan.g

Reputation: 27

Create a subpart menu for a one page template in typo3

I integrate a one page parallax template in typo 3 in this i want to get a menu like below so i can access specific content on click , in a subpart of page object.

<ul class="nav navbar-nav navbar-right">
    <li><a href="#header-section">HOME</a></li>
    <li><a href="#about-section">ABOUT</a></li>
    <li><a href="#price-section">PRICING</a></li>
    <li><a href="#contact-section">CONTACT</a></li>
    <li><a href="#contact-section">Call:&nbsp;+23-689-90  </a></li>
</ul>

Upvotes: 1

Views: 953

Answers (1)

Urs
Urs

Reputation: 5132

Try

temp.contentnav = CONTENT
temp.contentnav {
  table = tt_content
  select {
    pidInList = this
    orderBy = sorting
    where = colPos=0
    languageField=sys_language_uid

  }
  renderObj = TEXT
  renderObj {
    field = header 
    wrap=|

    typolink.parameter.field=pid
    typolink.parameter.dataWrap=|#{field:uid}
    if.isTrue.field=header
  }


}

So you will get an menu of all items. Then again, you won't like that the menu item's title is taken from the header field. If your site is very small and you keep control over it, why don't you just hardcode this (look at the source, by default, each article has an id).

PS I copied that from http://www.typo3wizard.com/en/snippets/menus/content-element-navigation.html


EDIT on your getting started with TS question:

In your HTML Template:

   <html>...
   <!-- ###CONTENTNAV### START --><!-- ###CONTENTRIGHT### END -->
   ...</html>

In your TypoScript setup:

page.10.subparts {
    # we fill the "subpart" (that's how this type of marker is called) with the temp object
    CONTENTNAV < temp.contentnav
}

So the caret pointing left tells TYPO3 that in that region ("subpart"), it should add the content menu you've created with the TS snippet.

Note that you can also use "Marks" (###CONTENTNAV###, don't need start and end commentary, assign with page.10.marks) and the more modern fluid templates (<f:format.html>{contentnav}</f:format.html>), which are the future. You could start here: http://typo3buddy.com/typo3-template-tutorial/fluid/

Upvotes: 1

Related Questions