Stefan Ernst

Typo3: goof_fotoboek and CoolURI

Hörnchen in the gallery

I integrated the Photo Book (goof_fotoboek) extension in one of my Typo3 sites, because I wanted a simple and reliable little gallery function. It works very well if you like managing your files and directories manually - and has some nice (including watermark) option to secure your images decently.

Now there was, which is the case with many extensions, the problem of ugly URLs/URIs.

Using CoolURI I didn't find it acceptable to have variables posted all over my address bar, so I came up with a little fix for CoolURI. Simply insert the following lines into the <uriparts> section of your CoolUriConf.xml file:

    <part>
      <parameter>tx_gooffotoboek_pi1[srcdir]</parameter>
    </part>
    <part>
      <parameter>tx_gooffotoboek_pi1[fid]</parameter>
    </part>   
    <part>
      <parameter>tx_gooffotoboek_pi1[func]</parameter>
    </part>

It should look something like this then:

  <uriparts>
    <part>
      <parameter>tx_ttnews[tt_news]</parameter>
      <lookindb>
        <to>SELECT title FROM tt_news WHERE uid=$1</to>
        <translatetoif>
          <match>^[0-9]+$</match>
        </translatetoif>
        <t3conv>1</t3conv>
      </lookindb>
    </part>
    <part>
      <parameter>tx_eeblog[showUid]</parameter>
      <lookindb>
        <to>SELECT subject FROM tx_eeblog_maintable WHERE uid=$1</to>
        <translatetoif>
          <match>^[0-9]+$</match>
        </translatetoif>
        <t3conv>1</t3conv>
      </lookindb>
    </part>
    <part>
      <parameter>tx_gooffotoboek_pi1[srcdir]</parameter>
    </part>
    <part>
      <parameter>tx_gooffotoboek_pi1[fid]</parameter>
    </part>   
    <part>
      <parameter>tx_gooffotoboek_pi1[func]</parameter>
    </part>
  </uriparts>

That's it, now your URIs should look like this:

/photogallery/Album/1/thumb.html
/photogallery/Album/1.html

The RealURL Setup would look something like this (taken from the CoolURI tutorial actually):

   'postVarSets' => array(
             '_DEFAULT' => array (
                 'photobook' => array(
                     array('GETvar' => 'tx_gooffotoboek_pi1[srcdir]'
                    ),
                    array(
                         'GETvar' => 'tx_gooffotoboek_pi1[fid]'
                     ),
                     array(
                         'GETvar' => 'tx_gooffotoboek_pi1[func]',
                         'valueMap' => array(
                             'thumbnails' => 'thumb',
                         ),
                     ),
                 ),
             ),
    )

Good luck. :)

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
Are you human?
                                                                    

iiii kkkkkkkk
i::::i k::::::k
iiii k::::::k
k::::::k
qqqqqqqqq qqqqq iiiiiii k:::::k kkkkkkk ssssssssss
q:::::::::qqq::::q i:::::i k:::::k k:::::k ss::::::::::s
q:::::::::::::::::q i::::i k:::::k k:::::k ss:::::::::::::s
q::::::qqqqq::::::qq i::::i k:::::k k:::::k s::::::ssss:::::s
q:::::q q:::::q i::::i k::::::k:::::k s:::::s ssssss
q:::::q q:::::q i::::i k:::::::::::k s::::::s
q:::::q q:::::q i::::i k:::::::::::k s::::::s
q::::::q q:::::q i::::i k::::::k:::::k ssssss s:::::s
q:::::::qqqqq:::::q i::::::i k::::::k k:::::k s:::::ssss::::::s
q::::::::::::::::q i::::::i k::::::k k:::::k s::::::::::::::s
qq::::::::::::::q i::::::i k::::::k k:::::k s:::::::::::ss
qqqqqqqq::::::q iiiiiiii kkkkkkkk kkkkkkk sssssssssss
q:::::q
q:::::q
q:::::::q
q:::::::q
q:::::::q
qqqqqqqqq
Enter the code depicted in ASCII art style.