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

UPDATE: Request for MySQL query to select all posts in a category?

Development and Programming

navertise's avatar
navertise
5 posts
14 years ago
navertise's avatar navertise

Hey guys,

I’m trying to use a semi-category-based navigation sidebar to display the posts that are in the same section as the current post being viewed on the entry page. It works, except that it doesn’t display the current post for that page. For example, if I’m viewing entry_id #35, it shows everything in the same category as entry_id #35 EXCEPT for entry_id #35.

Any suggestions? Here’s my code:

{exp:channel:entries channel="about" related_categories_mode="yes"} {if "<?php echo $pageURL; ?>" == page_url OR last_segment == url_title} <li class=”current”>{title}</li> {if:else} <li><a href=”http://{if">{title}</li> {/if} {if no_results} {embed='includes/inc_section_index_about'} {/if} {/exp:channel:entries}

Any suggestions?

       
navertise's avatar
navertise
5 posts
14 years ago
navertise's avatar navertise

I’ve played around with this for some time and it seems (yet again) that a MySQL query is the only way to accomplish what I’m wanting to do.

What I need is a MySQL script that I can plug into a Query tag. It needs to select the entry_id from exp_channel_titles where the url_title matches {last_segment}, then take that entry_id, match that entry_id to the corresponding entry in exp_category_posts and then match that row’s cat_id to all of the other posts that share that cat_id.

Clear as mud, right?

Now, does anyone know how to go about creating a SQL query like that? Your help would be GREATLY appreciated.

       
navertise's avatar
navertise
5 posts
14 years ago
navertise's avatar navertise

Anyone?

       

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.