Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: <txp:mdm_if_category>
Ah, so that’s the issue. I was trying to use this on article pages, in the sense of “if this article belongs to X category…” which apparently isn’t the intended use. Perhaps some clarification in the documentation for the plugin is in order.
Thanks for the heads-up, though! (I just made a workaround for my particular problem using the <a href=“http://forum.textpattern.com/viewtopic.php?id=2481”>if_empty</a> plugin.)
Offline
Re: <txp:mdm_if_category>
Yay, ready to use the plugin but
The link is dead. Could someone post the plugin? or point me in the right direction?
Offline
Re: <txp:mdm_if_category>
had that problem too. I got a copy from the google cache: look up mdm_if_category on google. On the second page there’s a direct link to the plug-in. Click on ‘In Cache’ next to the link and save the entire page as a txt-document. Trim off the HTML at the top and bottom, correct the beginning and end of the plug-in text (there’s an &…; instead of a single quote – just look at an existing plug-in for the beginning/end format). Then load-up ;-)
TXP Builders – finely-crafted code, design and txp
Offline
Re: <txp:mdm_if_category>
My apologies…
I have just switched hosting to textdrive, and I haven’t setup the files yet. I should get to it perhaps later today.
Offline
Re: <txp:mdm_if_category>
Okay, the new site is still mostly empty, but the plugin files should be available for download.
If you still can’t get at them, leave any errors or symptoms here and I’ll check it out.
Offline
#54 2005-03-12 18:09:20
- alexwest
- Member
- From: Järna, Sweden
- Registered: 2004-08-04
- Posts: 53
Re: <txp:mdm_if_category>
I am using mdm_if_category in a website where I need to condition content to categories in an article page. At first, it didn’t seem to work but going through the forum I found this topic Getting mdm_if_category to work. But the <code>parse(“<txp:category1 />”)</code> bit of code suggested to get the right category wouldn’t work either.
Investigating some more, I ended up getting the result I wanted using the global variable <code>$thisarticle</code> like this: <code>$thisarticle[“category1”]</code>. This enabled me to get the current category for the article page in mdm_if_category.
The reason I am posting this is, there was a slight workaround that I found necessary. I could only get <code>$thisarticle</code> after I had run the <code><txp:article /></code> tag and thus mdm_if_category would only work after the article tag. Because I wanted to display the conditioned content before the article I had to still work with my code. Two solutions I found where:
- place an article tag before the conditions and make it display in a form without any content whatsoever;
- place the conditions inside the form I was using to display the article tag.
The second seems to be the better. Still I question if there is any other way known to get the ‘category’ of the article before the article tag is run.
Last edited by alexwest (2005-03-12 18:12:06)
be safe and happy
Offline
Re: <txp:mdm_if_category>
yes, i would really like to be using this plugin too..
also, there are good reasons for why having it recognize both category1 and also category2 would be valuable..
textpattern.org :: find and share Textpattern resources
docs.textpattern.io :: Textpattern user documentation
Offline
#56 2005-05-07 15:27:29
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: <txp:mdm_if_category>
I just moved up from g1.19 to 1.0rc3, and part of this plugin doesn’t seem to work anymore.
For the default section, I had it on my page twice:
1. <code><txp:mdm_if_category category=”!”>article tags</txp:mdm_if_category></code> (for the front page) and <code><txp:mdm_if_category category=”“>article tag</txp:mdm_if_category></code> (for the category pages). This one still works.
2. <code><txp:mdm_if_category category=”!”>some text</txp:mdm_if_category></code> and <code><txp:mdm_if_category category=”“>some other text</txp:mdm_if_category></code>. This one doesn’t work anymore. On a category page it outputs the text meant for the front page.
Never mind, I switched to glx_if. But I thought you might want to know.
Offline
Re: <txp:mdm_if_category>
I had to hack the code a bit, cause i could get it working on article listing pages OR individual pages, but not both.
<code>
//I commented the following line out and replaced by the code below:
//$curr_cat = gps(“c”);
//new code so it will hopefully recognize my categories:
$curr_cat = parse(“<txp:category1 />”);
if (empty($curr_cat)) {
$curr_cat = gps(“c”);
}
//end kemiehack
Last edited by kemie (2005-05-08 11:30:20)
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
Re: <txp:mdm_if_category>
anyone know where this plugin is still available from? Keep getting errors on the download.
Thanks in advance
Offline
Re: <txp:mdm_if_category>
There’s a TXP tag now you know. I’ve removed this plug-in.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#60 2005-07-23 22:32:45
- lee
- Member
- From: Normandy, France
- Registered: 2004-06-17
- Posts: 831
Re: <txp:mdm_if_category>
be nice if there was an if section.
Offline