Request: category_id
Posted: 21 July 2004 01:19 PM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1506
Joined  05-15-2004

See: http://www.pmachine.com/forum/threads.php?id=19414_0_19_0_C

A category_id for use in the {categories}{/categories} variable pair and in {ex:weblog:categories} would be useful for hardcoding category URLs (for example in the case of multi-blog pages) in the same way that {entry_id} is used to hardcode entry URLs.

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 03 August 2004 06:13 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1506
Joined  05-15-2004

After pondering this issue some more, I am wondering if the best approach might not be a variable than can be used instead of path/permalink/entry_id_path/etc in situations where hardcoding a link is necessary.

This variable could allow you to give the full URL _except_ for the entry id, category id, member id or whatever is required for the link in question. The id would then be added automatically, just as it is when you use for example path or permalink. This would seem like the most consisten approach.

Of course, for the sake of completeness, it would still be nice to have category_id to match entry_id. And the same goes for any other id types that are added automatically to certain kinds of links but which don’t currently have a corresponding variable. But maybe category_id is the only missing one?

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 03 August 2004 09:31 AM   [ Ignore ]   [ # 2 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  520
Joined  05-14-2004

I’d like to second this one. In fact, there are a number of variables that might be nice to have access to in various tags. Most of which I can’t recall off top of my head at the moment because I forgot to write them down. grin

I’ll start keeping a list of variables that would be nice to have once I hit a situation where I find I don’t have one again. grin

 Signature 

“I was gratified to be able to answer promptly, and I did. I said I didn’t know.” - Mark Twain, Life on the Mississippi

Profile
 
 
Posted: 03 August 2004 09:35 AM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

> This variable could allow you to give the full URL _except_ for the entry id, category id, member id or whatever is required for the link in question. The id would then be added automatically

That’s exactly what the current {path=} tag does when you use it inside either {categories}{/categories} or {exp:weblog:categories}.  I don’t understand how what you’re proposing is different.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 03 August 2004 10:34 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1506
Joined  05-15-2004

But {path=} only allows you to specify {path=template_group/template}, no? I am looking for something that allows me to do this:

{path=http://www.domain.com/index.php/template_group/template/} and which, for example, will add on the category ID itself when used within {categories}{/categories} or {exp:weblog:categories}. Or the entry ID in other circumstances.

Essentially, it would be like hardcoding the URL expect you wouldn’t have to add {entry_id} or any other id tags yourself.

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 03 August 2004 09:13 PM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

I think you would be better off simply with a {category_id} variable like the original idea.  Then you just do:

http://www.domain.com/index.php/template_group/template/{category_id}

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 04 August 2004 12:38 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1506
Joined  05-15-2004

Certainly works fine for me. I was just thinking that since using the variables auto-adds the id, it might be more intuitive to have something that worked that way.

But {category_id} would do the job just fine. smile Are there any other ids ‘missing’ that are auto-added by certain variables but which currently can’t be added manually?

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

Profile
 
 
Posted: 04 August 2004 01:13 PM   [ Ignore ]   [ # 7 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9868
Joined  06-19-2002

The “page ID” if pagination is in use would be the only other one I can think of.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 04 August 2004 04:23 PM   [ Ignore ]   [ # 8 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1506
Joined  05-15-2004

That would definitely be another good one to have available. smile

 Signature 


:: Westeros :: Hippoi Athanatoi ::

Blackadder: “Baldrick, have you no idea what irony is?”   
Baldrick: “Yeah! It’s like goldy and bronzy, only it’s made of iron.”
Blackadder III, Amy and Amiability

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: 65027 Total Logged-in Users: 25
Total Topics: 82117 Total Anonymous Users: 15
Total Replies: 441316 Total Guests: 201
Total Posts: 523433    
Members ( View Memberlist )