Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#25 2004-06-11 14:33:58
- DougBTX
- Archived Plugin Author
- Registered: 2004-05-23
- Posts: 22
Re: <txp:mdm_if_category>
You could put “same code here” in a form and call that :)
I’m sure this could be added to the code though (catagory list; if you want to get fancy I’m sure a “not_category” tag could be set up too.)
Douglas
Offline
Re: <txp:mdm_if_category>
Trouble is, between those tags are <code><txp:article form=“lists” /></code> type stuff, so they couldn’t go into a form.
No worries, I’m fine with it as it is – ecstatic in fact! – but I wanted to check that there wasn’t a neater way of doing it.
Cheers,
Jon VC#9
Offline
Re: <txp:mdm_if_category>
Thus didst the mobs cry out, “Givest us feature X and we shall bestow upon thee the gold and fine wines.” And so didst he give them feature X, and they were joyful, yet upon installation of thus fine software product, they didst forget their promises.
Okay, enough crap. Here is version 0.3, which includes the features you guys wanted. You can list multiple categories (so “alpha,beta” is like “alpha OR beta”). You can also negate the query by prefixing with an exclamation mark (so “!alpha” is “NOT alpha” and “!alpha,beta” is “NEITHER alpha NOR beta”).
Also note that the use of “*” is gone… so if you were using that, please check the help for the plugin in the textpattern admin interface. All the options are explained in the help, hopefully clearly.
(Hmmm, Givest?? That can’t be correct…)
Offline
Re: <txp:mdm_if_category>
haha! Verily I say unto thee, thou art truly the man!
Just in case – my comment wasn’t a criticism or request for a change in the plugin. But hey! I’m not complaining – this is excellent, thanks again!
(I can’t manage fine wines and gold, but a link will be in order…)
Cheers,
Jon VC#9
Offline
Offline
Re: <txp:mdm_if_category>
There might be a bug (or a feature) because when I insert <txp:pfr /> inside the plugin code as shown below, it creates a broken link to <pre>http://www.mydomain.com/<txp:pfr />agentur/?c=Team</pre> which is not really what should be there.
<code><pre>
<txp:mdm_if_category category=“Leistungen”>
<li class=“active”><dfn>1.1: </dfn>Leistungen</li>
<li><dfn>1.2: </dfn><a href=”<txp:pfr />agentur/?c=Team” title=“Wer arbeitet bei anatom5?” class=“noNiceTitle” lang=“en”>Team</a></li>
<li><dfn>1.3: </dfn><a href=”<txp:pfr />agentur/?c=Kontakt” title=“So erreichen Sie uns” class=“noNiceTitle”>Kontakt</a></li>
</txp:mdm_if_category>
</pre></code>
This might also be related to my <a href=“http://forum.textpattern.com/viewtopic.php?id=2771”>earlier post</a> regarding this plugin and another one. Any hints or ideas?
Offline
Re: <txp:mdm_if_category>
The plugin I wrote simply passes out the content between the start and end tags, so as written any txp tags inside do not get handled. What should be done is to take the content between the tags and pass it back into textpattern for further evaluation.
How that is done, I don’t know. I haven’t looked into it, and am busy on several other higher-priority things. If someone knows what function or bit of code I need to have the content further evaluated, please let me know and I’ll revise the plugin to use that.
Offline
Re: <txp:mdm_if_category>
You can tell txp to parse the enclosed text with a call to <code>parse($text);</code> in place of where you return the enclosed code.
Offline
Re: <txp:mdm_if_category>
In the meantime I used a workaround with inline PHP which works well for me. I wish I was a better PHP coder so that I could put the workaround into some abstract PHP code and make a plugin out of it.
The only thing I have manged on my own so far is a “plugin” to detect which browser the user is running and deliver custom content.
Offline
Re: <txp:mdm_if_category>
Okay, the plugin has been updated. Version 0.4 of the mdm_if_category plugin is now available.
Offline
Re: <txp:mdm_if_category>
Great. Thank you very much. This makes things much easier.
Offline
#36 2004-11-16 14:06:55
- apo
- Member
- From: Germany
- Registered: 2004-10-27
- Posts: 53
Re: <txp:mdm_if_category>
can anyone provide a link? splatbang seems to be down or something…
Offline