Results 1 to 2 of 2

Thread: auto_item

  1. #1
    User
    Join Date
    07-08-10.
    Location
    Madrid, Spain
    Posts
    145

    Default auto_item

    Hello

    In the 2.11 when I check the "Use the auto_item parameter" option, links to catalog elements are not working.
    Is there a workaround to this issue ?

    Thanks for your help
    Eric
    Contao 2.8 -> 3.0
    Evizer Web Agency

  2. #2
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: auto_item

    I don't know about the current state of the catalog but catalog uses "items" in the url which is already an auto_item. So Contao already recognized that. You can try and edit ModuleCatalog.php (NOT UPDATE SAFE) and prefix every function that has "$this->get('items')" in it with the following code:

    Code:
    // Set the item from the auto_item parameter
    if ($GLOBALS['TL_CONFIG']['useAutoItem'] && isset($_GET['auto_item']))
    {
        $this->Input->setGet('items', $this->Input->get('auto_item'));
    }
    You probably have to change the code somewhere to make sure the "items" part is not added to any URL's, but I am not really sure where in the code that is. You can find it easily though. Contao core uses this to decide whether or not to add the parameters:
    Code:
    ($GLOBALS['TL_CONFIG']['useAutoItem'] ?  '/' : '/items/')
    One note: if you need to add another parameter as an auto_item you can do that via a config.php:
    Code:
    $GLOBALS['TL_AUTO_ITEM'][] = 'youritem';
    (and these parameters need to be handled by every function that retrieves that specific get parameter in the same way as I showed above.)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •