Results 1 to 7 of 7

Thread: catalog URL

  1. #1
    New user
    Join Date
    03-24-10.
    Posts
    13

    Default catalog URL

    Hi to all.
    Is there a way to delete the "/items/" piece from the URL of the catalog page generated when I browse catalog elements?
    I saw that this piece of URL is present in both:
    ModuleCatalog.php
    CatalogExt.php
    I tried to replace this "/items/" with only a "/" and it seems to be working only in the typolight's indexed pages, but when I want to browse a catalog element the "page cannot be found"... (only if I add manually the "/items/" piece to the URL I can see the catalog's element details)
    Is there a way to delete completelly this piece of URL?
    thanks.

  2. #2
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: catalog URL

    This is following the standard READER module guidelines for Contao (TL). You could possibly do this using mod_rewrite keywords in the .htaccess file in your tl_root. TL is simply doing this:

    page.html?items=thisismyitemalias

    ... and already re-maps this to a unified url:
    page/items/thisismyitemalias.html

    so without the items=? part, there is no GET variable, making the entire system non-functional.

  3. #3
    New user
    Join Date
    10-01-10.
    Posts
    2

    Default Re: catalog URL

    Hi,

    USE PLEASE urlcleaner, I'LL LEAVE HERE THIS SOLUTION ONLY FOR UNEXPECTED NEED OF HARDCODING.

    I have been working on that for three hours. Last comment in this post helps me a lot to solve this problem.

    To replace 'items' for whatever you want you need:

    1) To find the files:
    root/system/modules/catalog/CatalogExt.php
    root/system/modules/catalog/ModuleCatalog.php
    root/system/modules/catalog/ModuleCatalogEdit.php

    and in each of them replace all instances of "items" with "anythingIWant"

    2) Find the file root/.htaccess and insert on first line (before any code)

    Code:
    RewriteRule ^(.+)/anythingIWant/(.+).html$ %{DOCUMENT_ROOT}/$1.html?items=$2 [L]
    3) Set in your contao administration->settings mod_rewrite to enabled (check the checkbox)

    :!: NOTE: :!:
    1) You need mod_rewrite enabled on your server
    2) Everything in quotes refers to exact string in file, so find all instances of "items" without quotes and so on
    3) Replace "anythingIWant" with any string which can be passed to url, I strongly recommend something in format like "dvd" or "dvd_collection"
    4) The final URL will be like:
    Code:
    http://www.domain.xy/catalogAlias/anythingIWant/alias.html

  4. #4
    New user
    Join Date
    03-24-10.
    Posts
    13

    Default Re: catalog URL

    Wow! beautiful!
    Does it works fine?
    I'll try it in the next catalogs I'll make!
    Thanks a lot!
    Giancarlo.

  5. #5
    User
    Join Date
    01-20-11.
    Location
    Germany
    Posts
    77

    Default Re: catalog URL

    Hello,

    in the meantime there's a the extension urlcleaner which can remove the /item/ (and other unwanted parts like for events and news) from the URL. This might make your work more easy. ;-)

    Jan
    Free support only here in the forum.
    Please report bugs for my extensions using http://www.contao-forge.org. Thanks!
    Requests for Contao support and development please send mail to jan@theofel.de

  6. #6
    New user
    Join Date
    10-01-10.
    Posts
    2

    Default Re: catalog URL

    Quote Originally Posted by ETES
    Hello,

    in the meantime there's a the extension urlcleaner which can remove the /item/ (and other unwanted parts like for events and news) from the URL. This might make your work more easy. ;-)

    Jan
    Hi,

    this is a much better way to remove that ugly url fragments. Please use the urlcleaner and NOT the hardcoding I've posted above.

    Hardcoding is NOT a way of object oriented programming and potentially can cause problem of compactibility.

    Even so, I hope that my solution helps someone, before this extension was released.

    Thank you ETES

  7. #7
    New user
    Join Date
    03-24-10.
    Posts
    13

    Default Re: catalog URL

    So, I'll try it!

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
  •