Category URL Title?
Posted: 03 July 2007 05:50 AM   [ Ignore ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

Somehow related to this thread (“Have you merged today?”), I, too, was wondering about a way to determine the category url title. I am building a rather complex navigation menu based on categories, and using Cx is not an option for the client.

I have two options, currently:

- Use a custom category field that the client needs to set for every category (and tends to forget)
- Use {exp:query} one more time

If there is no {category_url_title} there should be—in case of which this might be considered a FR and be moved appropriately. Thank you.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 03 July 2007 06:06 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  591
Joined  10-22-2006

Inside weblog:entries it’s

{categories}{category_url_title}{/categories}

Inside weblog:category_heading there’s no variable (yet). You’d have to get it from the URL segment.

Profile
 
 
Posted: 03 July 2007 06:11 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

It really is? Is that documented somewhere, too? Cause a casual search in the docs revealed nothing.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 03 July 2007 06:58 AM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15727
Joined  06-03-2002

Looks like it got overlooked in the doc updates.  Moving to the FR forum since as silenz points out, there is not such a variable in the category heading tag.

 Signature 
Profile
MSG
 
 
Posted: 03 July 2007 06:59 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

Ok, works as intended (but not advertised). Thanks.

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 03 July 2007 08:19 AM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15727
Joined  06-03-2002

Oversight in the docs fixed.

 Signature 
Profile
MSG
 
 
Posted: 05 July 2007 11:53 PM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1576
Joined  01-05-2007

Is there a way to gather the Category ID from the {category_url_title}?

I want to list entries in a particular category group and I’m targetting segments so although this parameter doesn’t exist for weblog entries I want to achieve something to the same affect -

{exp:weblog:entries weblog="foo" category="{category_url_title}"}

My URL structure is -

http://www.website.com/index.php/templategroup/template/category/category_url_title

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
Posted: 06 July 2007 03:59 AM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15159
Joined  05-15-2004

Of course there “is a way to gather the Category ID from the {category_url_title}”, but it requires a quick trip down SQL lane. Try this:

{exp:query sql="SELECT cat_id AS my_cat_id FROM `exp_categories` WHERE cat_url_title = '{cat_url_title}'"}
{exp
:weblog:entries weblog="foo" category="{my_cat_id}"}
...
{/exp:weblog:entries}
{
/exp:query}

 Signature 

Everything will be good in the end. If it’s not good, it’s not the end.

Profile
MSG
 
 
Posted: 06 July 2007 05:07 AM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  15727
Joined  06-03-2002

If you let tags do their jobs dynamically, you do not need the category= parameter when using category URL titles; just a suggestion.

 Signature 
Profile
MSG
 
 
Posted: 06 July 2007 05:13 AM   [ Ignore ]   [ # 9 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1576
Joined  01-05-2007

Yep wink

Hambo’s EE Epiphany

 Signature 

 
Steven Hambleton | ExpressionEngine Development for Web & Graphic Design Agencies

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64491 Total Logged-in Users: 55
Total Topics: 81033 Total Anonymous Users: 26
Total Replies: 436067 Total Guests: 287
Total Posts: 517100    
Members ( View Memberlist )