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?
                                                                                    

hhhhhhh 333333333333333 ffffffffffffffff
h:::::h 3:::::::::::::::33 f::::::::::::::::f
h:::::h 3::::::33333::::::3 f::::::::::::::::::f
h:::::h 3333333 3:::::3 f::::::fffffff:::::f
h::::h hhhhh 3:::::3 qqqqqqqqq qqqqq f:::::f ffffff
h::::hh:::::hhh 3:::::3 q:::::::::qqq::::q f:::::f
h::::::::::::::hh 33333333:::::3 q:::::::::::::::::q f:::::::ffffff
h:::::::hhh::::::h 3:::::::::::3 q::::::qqqqq::::::qq f::::::::::::f
h::::::h h::::::h 33333333:::::3 q:::::q q:::::q f::::::::::::f
h:::::h h:::::h 3:::::3 q:::::q q:::::q f:::::::ffffff
h:::::h h:::::h 3:::::3 q:::::q q:::::q f:::::f
h:::::h h:::::h 3:::::3 q::::::q q:::::q f:::::f
h:::::h h:::::h 3333333 3:::::3 q:::::::qqqqq:::::q f:::::::f
h:::::h h:::::h 3::::::33333::::::3 q::::::::::::::::q f:::::::f
h:::::h h:::::h 3:::::::::::::::33 qq::::::::::::::q f:::::::f
hhhhhhh hhhhhhh 333333333333333 qqqqqqqq::::::q fffffffff
q:::::q
q:::::q
q:::::::q
q:::::::q
q:::::::q
qqqqqqqqq
Enter the code depicted in ASCII art style.