[TYPO3] CoolURI: 2 DB-Fields in one URI-Part

Oliver Berg o.berg at 5thaxis.net
Wed Oct 31 01:35:59 CET 2007


Hi there!

First of all thanks to Jan for this really cool extension.

I have a small problem though:
Currently I'm translating the uid-parameter of one of my custom 
extensions to the record-title which is fetched out of the database. 
This is done with the following lines in the XML:

<uriparts>
<part>
  <parameter>tx_twjobs_pi1[job_uid]</parameter>
  <lookindb>
    <to>SELECT title FROM tx_twjobs_offers WHERE uid=$1</to>
    <translatetoif>
      <match>^[0-9]+$</match>
    </translatetoif>
    <t3conv>1</t3conv>
  </lookindb>
</part>
...
</uriparts>

The problem is, that this title isn't unique. It is possible that 
another record has the same title and so CoolURI generates the same 
URI-Path multiple times. As a solution I wanted to include the uid of 
the record in the part segment just before the title like that:

<pagepath>/<uid>-<title>/

(Ideally the uid should be formatted to a fixed number of chars with 
leading zeros.)

But how do I do this? I've read the manual, scanned the examples on the 
tutorial-page from Andreas, read the diploma thesis from Jan and I 
still have no clue how to achieve this (maybe I just missed some 
point...).

Can someone please give me hint?

Thanks in advance,

Oliver.



More information about the TYPO3-english mailing list