Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Conditionally output something based on comment cookie
This thread describes a plugin, but says that the functionality is now included in the TXP core.
I would like to output a little snippet based on whether or not the “remember” cookie has been set, but I don’t see anything like that on Textbook.
Is that plugin’s functionality really available in the core now? Is there a conditional tag I can use?
Thanks in advance.
Offline
Re: Conditionally output something based on comment cookie
Setting variable named cookie
:
<txp:variable name="cookie" value='<txp:php> echo (isset($_COOKIE["txp_remember"])) ? "set" : ""; </txp:php>' />
After that:
<txp:if_variable name="cookie" value="set">
He knows us.
<txp:else />
I like anon.
</txp:if_variable>
Offline
Re: Conditionally output something based on comment cookie
Awesome!! Exactly what I needed and works like a charm. Thank you so much.
Offline