Tags:tag weblog entries
Posted: 29 September 2008 01:52 PM   [ Ignore ]
Newbie
Rank
Total Posts:  5
Joined  2008-06-10

For the {weblog_entries} value returned by the {exp:tag:tags} query, is there a way to make the count only reflect open entries that carry the tag?

Profile
 
 
Posted: 30 September 2008 06:30 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Does the “status” parameter not affect the results? smile

status="open"

 Signature 
Profile
 
 
Posted: 30 September 2008 07:20 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  5
Joined  2008-06-10

Doesn’t seem to be. Looks like it counts closed entries either way, and looking at the mod.tag.php function it doesn’t look the SQL query for the tags is qualified based on status.

Profile
 
 
Posted: 30 September 2008 06:46 PM   [ Ignore ]   [ # 3 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

I just want to make sure I understand you correctly… what is it you’re exactly trying to do? smile
Are you trying to hide the Tag:Tags loop if the entry is closed.... or something? smile

 Signature 
Profile
 
 
Posted: 01 October 2008 07:58 AM   [ Ignore ]   [ # 4 ]
Newbie
Rank
Total Posts:  5
Joined  2008-06-10

Basically, at the bottom of my blog entry/article template, I want to list the tags that the entry carries and how many other entries are tagged with it. I’ve been using a {exp:tag:tags} query for it, and spitting out the {weblog_entries} value in it for the number of entries that carry that tag. Problem is that the count that {weblog_entries} gives seems to be open and closed articles, and status=open doesn’t seem to affect it.

Profile
 
 
Posted: 01 October 2008 09:43 AM   [ Ignore ]   [ # 5 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Hmmm… I’m sure you’re well aware though, that the Tag:Tags function is merely to list the Tags that are applied to that entry in question. Presumably, entry status would never be in question.

I will however, add this to the Feature Requests smile

 Signature 
Profile
 
 
Posted: 01 October 2008 09:55 AM   [ Ignore ]   [ # 6 ]
Newbie
Rank
Total Posts:  5
Joined  2008-06-10

Is there a better way for me to do what I’m after? Listing the tags associated with an entry and the number of (open) entries in the system with those tags?

Profile
 
 
Posted: 01 October 2008 10:05 AM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18
Kenneth Hoffmann - 01 October 2008 09:55 AM

Is there a better way for me to do what I’m after?

I don’t believe so. Tag:Cloud would be your best bet, but it obviously just shows ALL Tags, instead of for that entry.

I’m going to see if we can fold this into the upcoming version release of Tag wink

I definately like the idea smile

Just to make sure we’re clear, you’re trying to do something like this?

Tagspants (7), peanuts (13), acorns (2).

 Signature 
Profile
 
 
Posted: 01 October 2008 10:07 AM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  5
Joined  2008-06-10

Yep, that’s it. Thanks for your help.

Profile
 
 
Posted: 01 October 2008 12:17 PM   [ Ignore ]   [ # 9 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3356
Joined  2006-10-18

Kenneth,

Try this Query:

SELECT COUNT AS count
FROM exp_tag_tags 
AS ttexp_tag_entries AS teexp_weblog_titles AS wt
WHERE tt
.tag_id te.tag_id
AND te.entry_id wt.entry_id
AND wt.status 'open'
AND tt.tag_name '{tag_name}'

 Signature 
Profile