Extend RealUrlAutoConfiguration to support new actions

Issue #13 closed
Georg Tiefenbrunn created an issue

I've switch from 'album' to 'albums' in my static config and added the following instead of the actual pagination part. The following part adds parameters 'action' and 'mediaAssetUid' and produces URLs like

  • /albums/<album name>/
  • /albums/<album name>/assets/<assetUid>/
                    array(
                        'GETvar' => 'tx_fsmediagallery_mediagallery[action]',
                        'valueMap' => array(
                            'assets' => 'showAsset',
                        ),
                        'noMatch' => 'bypass'
                    ),
                    array(
                        'GETvar' => 'tx_fsmediagallery_mediagallery[mediaAssetUid]',
                    ),

Pagination is a bit tricky. I ended up with separating the widgets from album:

                'pages' => array(
                    array(
                        'GETvar' => 'tx_fsmediagallery_mediagallery[@widget_0][currentPage]',
                    ),
                ),
                'subpages' => array(
                    array(
                        'GETvar' => 'tx_fsmediagallery_mediagallery[@widget_1][currentPage]',
                    ),
                ),
  • /albums/<album name>//pages/<page no>/
  • /albums/<album name>//subpages/<page no>/

But this is all other than perfect (e.g. // after the album name).

Pagination of assets in nested album lists is not covered by the actual implementation (@widget_0 = pagination widget for albums list, @widget_1 = pagination widget for asset list).

We could also add a hint in the manual how to circumvent name clashes. E.g. prefix the album title with given date (attention: no mandatory field):

-                                   'alias_field' => 'title',
+                                   'alias_field' => 'concat(from_unixtime(datetime, \'%Y%m%d\')," ",title)',

Comments (3)

  1. Pat

    Hy,

    where I have to insert the code to activate real url for the gallery. In real url conf "postVarSets" it doesn't work.

    THX!

  2. Georg Tiefenbrunn reporter

    Hi Patta,

    that's a bit off topic here as the ticket targets RealURL autoconf, but try this:

    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
        '_DEFAULT' => array(
            // other RealURL stuff
            'postVarSets' => array(
                '_DEFAULT' => array(
                    'foo' => array(
                        // config for EXT:foo
                    ),
                    'bar' => array(
                        // config for EXT:bar
                    ),
                    'albums' => array(
                        array(
                            'GETvar' => 'tx_fsmediagallery_mediagallery[mediaAlbum]',
                            'lookUpTable' => array(
                                'table' => 'sys_file_collection',
                                'id_field' => 'uid',
                                'alias_field' => 'concat(from_unixtime(datetime, \'%Y%m%d\')," ",title)',
                                'addWhereClause' => ' AND NOT deleted',
                                'useUniqueCache' => 1,
                                'useUniqueCache_conf' => array(
                                    'strtolower' => 1,
                                    'spaceCharacter' => '-',
                                ),
                                'languageGetVar' => 'L',
                                'languageExceptionUids' => '',
                                'languageField' => 'sys_language_uid',
                                'transOrigPointerField' => 'l10n_parent',
                                'autoUpdate' => 1,
                                'expireDays' => 700,
                            ),
                        ),
                        array(
                            'GETvar' => 'tx_fsmediagallery_mediagallery[action]',
                            'valueMap' => array(
                                'assets' => 'showAsset',
                            ),
                            'noMatch' => 'bypass'
                        ),
                        array(
                            'GETvar' => 'tx_fsmediagallery_mediagallery[mediaAssetUid]',
                        ),
                    ),
                    'pages' => array(
                        array(
                            'GETvar' => 'tx_fsmediagallery_mediagallery[@widget_0][currentPage]',
                        ),
                    ),
                    'subpages' => array(
                        array(
                            'GETvar' => 'tx_fsmediagallery_mediagallery[@widget_1][currentPage]',
                        ),
                    ),
                ),
            ),
            // other RealURL stuff
        ),
    );
    

    Did you check that your config file is used by RealURL (filed "Path to configuration file" [basic.configFile] in EM, Info > RealURL management > Configuration)?

  3. Log in to comment