Hi,
I'm assigning a different header graphic for a recent comments widget depending on the page's category (label). When I'm on the category index of Share, the widget displays a comment from the Share category correctly, but the header is coming up with the graphic for a Learn category. The header is called up using a body_id variable that also shows up in the page's body tag where it's correct. To see what was going on, I put in an mt:CategoryLabel tag and lo and behold, the widget thinks it's in the Learn category, not Share! Yet when I put the mt:CategoryLabel tag in the main Sidebar template, it comes up with Share. I had this problem with another of my widgets as well. Any idea what's going on? I think I've seen this happen before.
The widget code for your reference:
<mt:Comments lastn="1" include_blogs="1" sort_order="descend"><div class="yousaid-module">
<h3><mt:If name="body_id" eq="learn"><img src="<$mt:BlogURL$>images/assets/headers/you-learned.gif" alt="You learned..." /><mt:ElseIf name="body_id" eq="share"><img src="<$mt:BlogURL$>images/assets/headers/you-shared.gif" alt="You shared..." /><mt:ElseIf name="share_templ" eq="Share"><img src="<$mt:BlogURL$>images/assets/headers/you-shared.gif" alt="You shared..." /><mt:ElseIf name="body_id" eq="do"><img src="<$mt:BlogURL$>images/assets/headers/you-did.gif" alt="You did..." /><mt:Else><img src="<$mt:BlogURL$>images/assets/headers/you-said.gif" alt="You said..." /></mt:If></h3><div id="yousaid-module-inner">
"<$mt:CommentBody words="15"$>..." — <$mt:CommentAuthor$> <br /><div id="yousaid-meta">On <a href="<$mt:CommentLink$>"><mt:CommentEntry><$mt:EntryTitle$></mt:CommentEntry> »</i></a></div></div>
</div></mt:Comments>
Thanks!
Erika
Reported on Movable Type 4.3
Where are you getting body_id from? Why not just do
<mt:If tag="CategoryLabel" eq="Share">
<mt:ElseIf tag="CategoryLabel" eq="Learn">
</mt:If>
body_id was one of my own variables. I couldn't do categorylabel because the content is tagged with a sub-category of share of which there are 8.
Our structure has changed so I'm not concerned about this issue anymore! Thanks, Mike.