Sitemap

Varianten von Sitemaps.

Erstellt: 10/2015| Geändert: 10/2015

Sitemap als unordered list (UL/LI)

Sitemap Setup, welches die Daten für ein Template Sitemap als Unordered list  (ul/li) erzeugt in Typoscript:

lib.sitemap = FLUIDTEMPLATE
lib.sitemap{
  ################
  ### TEMPLATE ###
  ################
  templateName = Sitemap
  templateRootPaths {
    0 = EXT:rsystemplate_bootstrap/Resources/Private/Templates/ContentElements/
  }
  partialRootPaths {
    0 = EXT:rsystemplate_bootstrap/Resources/Private/Partials/ContentElements/
  }
  layoutRootPaths {
    0 = EXT:rsystemplate_bootstrap/Resources/Private/Layouts/ContentElements/
  }
  ##########################
  ### DATA PREPROCESSING ###
  ##########################
  dataProcessing {
    10 = TYPO3\CMS\Frontend\DataProcessing\MenuProcessor
    10 {
      special = list
      special.value.field = pages
      levels = 7
      dataProcessing {
        10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
        10 {
          references.fieldName = media
        }
      }
    }
    90 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
    90 {
      if {
        isTrue.field = accessibility_bypass
      }
      table = tt_content
      pidInList = this
      orderBy = sorting
      max = 1
      where {
        dataWrap = colPos = {field:colPos} AND sorting > {field:sorting}
      }
      as = nextContentElement
    }
  }
}

Das Template sieht dann aus wie folgt

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
  <f:layout name="Default" />
  <f:section name="Main">
    <f:if condition="{menu}">
      <f:render partial="Menu/SkipNavigation" arguments="{_all}" />
    </f:if>
    <f:render section="Menu" arguments="{menu: menu}" />
  </f:section>
  <f:section name="Menu">
    <f:if condition="{menu}">
      <ul>
      <f:for each="{menu}" as="page">
        <li>
          <a href="{page.link}"{f:if(condition: page.target, then: ' target="{page.target}"')} title="{page.title}">{page.title}</a>
          <f:render section="Menu" arguments="{menu: page.children}" />
        </li>
      </f:for>
      </ul>
    </f:if>
  </f:section>
</html>

Erstellt: 07/2010| Geändert: 03/2023