Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-10-07 06:19:46

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,659
GitHub Twitter

Condition on page preview

Hi folks :)

Is there any way to have a conditional event into pages content for preview?
I have a StatCounter script in my pages and I don’t want to send informations when I’m preview my draft articles.

Thanks by advance for your ideas.

Cheers,


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2013-10-07 08:25:42

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Condition on page preview

<txp:if_custom_field match="any" name="status" value="4,5">
    <!-- Live or sticky -->
<txp:else />
   <!-- Something else -->
</txp:if_custom_field>

Offline

#3 2013-10-07 13:51:33

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,659
GitHub Twitter

Re: Condition on page preview

Hi Jukka ;)

Or maybe a conditional article tag with status=“1” (I’m not sure “1” is for “draft”)?


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB