Login / Status
developer.Resource
Home . Documentation . Document Library . Extension Manuals
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine

1.4. New stuff that's not yet in the manual

maxsegments

You can limit number of segment in pagepath using element maxsegments – subelement of pagepath element.

<pagepath>

    <title>tx_realurl_pathsegment, alias,subtitle,title</title>

    <saveto>id</saveto>

    <default>0</default>    

    <userfunc>tx_cooluri->getPageTitle</userfunc>

    <maxsegments>1</maxsegments>

</pagepath>

disabling page title processing

If you need a page title to stay exact the same as you have set it, you need to suppress the default page title processing from non-url-like form to url-like (I call this urlizing). To do this, you need to set subelement of the pagepath element urlize to 0.

<pagepath>

....

<urlize>0</urlize>

</pagepath>

exclude condition for suffix

Element urlsuffix now has optional attribute exclude and include. Element removetrailingslash has just include. Values of these attributes are passed to preg_match function. Anyway, one example is better than hundred words and three examples are even better:

Example 1

Let's say you want to

1) remove / from links that end with ".xml"

2) append ".html" to links that end with "foo" (without slash)

3) other links with slash

Then the config would be:

<urlsuffix include="foo$" exclude=".xml$">.html</urlsuffix>

<removetrailingslash include="(.xml|foo)$">1</removetrailingslash>

Example 2

Simple example - don't append slash to links ending with .xml and append .html to other:

<urlsuffix exclude=".xml$">.html</urlsuffix>

<removetrailingslash>1</removetrailingslash>

Example 3

Another - leave slash except when link ends with .xml:

<removetrailingslash include=".xml$">1</removetrailingslash>