We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Filter category search results

Development and Programming

Dotwebs's avatar
Dotwebs
13 posts
13 years ago
Dotwebs's avatar Dotwebs

Hi,

I want to create a simple form to display channel items listed in two or more categories. I have two select menus with categories, I have the following search query in my template which, of course, returns all results in all categories:

{exp:query sql="SELECT distinct(cat_id) FROM exp_category_posts LEFT JOIN exp_channel_data ON exp_category_posts.entry_id = exp_channel_data.entry_id LEFT JOIN exp_channels ON exp_channel_data.channel_id = exp_channels.channel_id WHERE exp_channels.channel_name = 'timeline' GROUP BY exp_category_posts.entry_id " backspace="1""}
{exp:channel:entries channel="timeline" status="open" category_group="1"}

So how does this work using variables to filter the results when the form returns the URL from the select as /mypage/C7 or /mypage/mycat ?

I want to add the code - e.g. catid = 7 - like PHP but I can’t work out how without the query string. ???

Any help appreciated. Thanks.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.