Results 1 to 5 of 5

Thread: Filter by tags & position of filter module

  1. #1
    New user
    Join Date
    05-03-10.
    Posts
    8

    Default Filter by tags & position of filter module

    Hello.

    First of all, a big thank you to everyone involved in the catalog extension, your work is appreciated.

    Using: Contao 2.9, Catalog 2.0.0 beta 1 and Taxonomy 0.1.7.

    While writing this I realize that Catalog and Taxonomy are not yet cleared for Contao 2.9, but I have experienced the same issues in 2.84

    I am currently having trouble with two issues:

    1. When using the Catalog filter module together with the Cat. List module, the filter only seems to work when it is placed under the same article as the List module. Which means that I can't have the filter in the left sidebar and the list in the main content container. The problem can be partly solved by assigning the filter to the left sidebar on all pages in themes/layout, but is of course not an ideal solution.

    If the filter is indeed not under the same article, it is simply not output in the FE at all.


    2. I have created taxonomy terms to be used as tags in Catalog items. I would also like to use these items in my filter module in the form of a select list. However, when I choose the tags in the filter module, I receive the following error in the FE:


    Code:
    Fatal error: Uncaught exception Exception with message Query error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM tl_catalog_projekte' at line 1 (SELECT FROM tl_catalog_projekte) thrown in /var/www/virtual/domain.com/subdomains/dev/htdocs/system/libraries/Database.php on line 642
    
    #0 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/libraries/Database.php(589): Database_Statement->query()
    #1 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/modules/catalog/ModuleCatalog.php(1084): Database_Statement->execute(Array)
    #2 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/modules/catalog/ModuleCatalogFilter.php(90): ModuleCatalog->generateFilter()
    #3 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/modules/frontend/Module.php(129): ModuleCatalogFilter->compile()
    #4 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/modules/catalog/ModuleCatalog.php(130): Module->generate()
    #5 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/modules/catalog/ModuleCatalogFilter.php(80): ModuleCatalog->generate()
    #6 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/libraries/Controller.php(271): ModuleCatalogFilter->generate()
    #7 /var/www/virtual/domain.com/subdomains/dev/htdocs/system/modules/frontend/PageRegular.php(71): Controller->getFrontendModule('8', 'left')
    #8 /var/www/virtual/domain.com/subdomains/dev/htdocs/index.php(198): PageRegular->generate(Object(DB_Mysql_Result))
    #9 /var/www/virtual/domain.com/subdomains/dev/htdocs/index.php(321): Index->run()
    #10 {main}
    As stated it seems this also happened in Contao 2.84, so I doubt it is a pure incompatibility issue with 2.9

    Any ideas?

    Cheers,

    Jesper.

  2. #2
    Experienced user
    Join Date
    08-21-09.
    Posts
    563

    Default Re: Filter by tags & position of filter module

    One thing I see -- and I don't know if this will fix your issues or not, but you should never prefix the table names of the catalogs you create as "tl_". Those are reserved, and in all likelihood will be whacked by the system every time the database is updated, as TL will think it's an orphaned table to a module that no longer exists.

    So something like "tl_catalog_projekte" I don't think will fly -- you want to use something like "cat_" instead.

    For the filter issue, under "Module Configuration", did you select the radio button for the catalog, and if that doesn't work, did you trying checking "Use filter condition from lister on same page" just to see if that works?
    Brian

  3. #3
    New user
    Join Date
    05-03-10.
    Posts
    8

    Default Re: Filter by tags & position of filter module

    Thank your for your reply. I removed the tl_ prefix from the table, which probably saved me a lot of future trouble, so kudos for spotting that.

    However it did not solve the problem of using tags to filter my Catalog list by. What is obvious from the error output is that the sql query being made has no values to query by, essentially going: SELECT blank FROM etc

    Oddly enough, I tried creating a test table with only a primary id and a name field. That worked just fine as an "Options source table" in my Catalog/Tags field. I then tried adding a pid field to the test table as most Contao tables have, including the taxonomy table, and I received the same error as before.

    So now the question is, why does the pid field mess things up?

    Regards,

    Jesper

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

    Default Re: Filter by tags & position of filter module

    Since the catalog tables are not interrelated like TL apps, setting up a pid field is a bit pointless, as there is no function in the catalog to make use of it, since you can't create multi-level editing like tl_theme => tl_stylesheet => tl_style.

    You can simply use any name and the link it to a category as a (select) or checkbox list (tags). FE Modules also only have limited understanding of table relationships. This is the main reason why the catalog is starting to fail it's design specs: Most are using it to design Contao Extensions instead of actually writing their own.

  5. #5
    New user
    Join Date
    05-03-10.
    Posts
    8

    Default Issue 2 solved

    Thanks Thyon for your reply.

    I solved the problem of the tags/taxonomy error. I made the stupid mistake of entering terms into Taxonomy directly, without first creating a parent term.

    Right: :D

    Taxonomy Terms
    • Parent Term
      [list:3ttv4nst]
    • Term 1[/*:3ttv4nst]
    • Term 2[/*:3ttv4nst]
    • Term 3[/*:3ttv4nst]

    [/*:3ttv4nst][/list:u:3ttv4nst]


    Wrong: :!:

    Taxonomy Terms
    • Term 1[/*:3ttv4nst]
    • Term 2[/*:3ttv4nst]
    • Term 3[/*:3ttv4nst]


    Which meant that the system attempted to use non-existing child-terms to query the db.

    Thanks again for your help.

    J

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
  •