Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
what does tag if_different do?
I’m really curious abot it’s behaviour… Example provided in wiki doesn’t tell anything me :) I uderstand it’s conditional tag, but as soon as it doesn’t have attributes – it’s strange and mysctic a little. Can you show some examples how does it works?
Last edited by the_ghost (2007-11-24 15:55:22)
Providing help in hacking ATM! Come to courses and don’t forget to bring us notebook and hammer! What for notebook? What a kind of hacker you are without notebok?
Offline
#2 2007-11-24 03:07:17
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: what does tag if_different do?
You would use it inside a form. When the form is loaded, if_different checks if the contents of the tag are different than last time the form loaded. If it is, it is displayed. If it isn’t, it is not. See this FAQ.
Offline
Re: what does tag if_different do?
It might be easier if you read my Simple Archives article which shows how the tag can be used. There is further reading in Simple Archives 2.
I can also tell you that a similar method was also used to produce the category listing in my front-page menu which only contains categories from a single section and also to produce the sidebar article listings in the other 2 sections.
It’s a very versatile tag that many seem to ignore, mostly in favour of a “quick-fix” plug-in. :(
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Re: what does tag if_different do?
if_different is quite missunderstood tag, it was also for at the begining, couple years ago. But it’s great tag, it can do all shorts of things, like thebombsite mentioned.
Like:
<txp:if_different><txp:category1 /></txp:if_different>
Could output with article_custom all categories form one section, taking use some plugins useless. It also could easily prevent same content some content outputted twice and all sorts of another things. But it doesn’t make coffey – I simply hate that. I’m still waiting that plugin – the one that will make coffey for me. Where is my xxx_coffeymaker ‘:(
Cheers!
Last edited by Gocom (2007-11-24 14:45:15)
Offline
Pages: 1