Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2019-01-11 08:23:26

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,223
Website

Re: previewing draft articles

I have tried Oleg’s suggestion which actually works but unfortunately, not for the way we wish our site to function.

True, that is a very specific situation that it could not properly cater for. Maybe the above approach would still offer you a way of improving your article preview output…


TXP Builders – finely-crafted code, design and txp

Offline

#12 2019-01-11 09:00:49

etc
Developer
Registered: 2010-11-11
Posts: 3,016
Website

Re: previewing draft articles

True, that is a very specific situation that it could not properly cater for.

Unless you put it into an individual article part of your template.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#13 2019-01-11 10:47:01

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,003
Website

Re: previewing draft articles

Thanks so much Julian but I feel that installing a plugin just for this minor issue, visible only to editors, is an overkill.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#14 2019-01-11 11:25:21

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,223
Website

Re: previewing draft articles

You could try Oleg’s suggestion or do the following instead of using adi_gps or rah_gps:

<txp:php>
global $variable;
$variable['txpreview'] = doSlash(gps('txpreview'));
</txp:php>

TXP Builders – finely-crafted code, design and txp

Offline

#15 2019-01-11 16:13:28

etc
Developer
Registered: 2010-11-11
Posts: 3,016
Website

Re: previewing draft articles

We has it too :-)

<txp:variable name="txpreview" value='<txp:page_url type="txpreview" />' />

etc_[ query | search | pagination | date | tree | cache ]

Offline

#16 2019-01-11 16:21:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,493
Website

Re: previewing draft articles

Nice! I’d forgotten about that.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#17 2019-01-11 19:36:13

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,003
Website

Re: previewing draft articles

So what you are talking about is:

<txp:variable name="txpreview" value='<txp:page_url type="txpreview" />' />
<txp:if_variable name="txpreview"  value="">
<txp:article status="sticky" form="">
....
</txp:article>

<txp:article status="live" form="">
....
</txp:article>

<txp:else />

<txp:article status="live" form="">
....
</txp:article>
</txp:if_variable>

!!!! looks very doable!!!!


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#18 2019-01-11 19:44:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,003
Website

Re: previewing draft articles

Also thinking back to it and as this only goes under the individual_article context Oleg’s code will actually also work!!!

Strange how a good night’s sleep improves our understanding!


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Offline

#19 2019-01-11 21:39:53

jakob
Moderator
From: Germany
Registered: 2005-01-20
Posts: 3,223
Website

Re: previewing draft articles

We has it too :-)

<txp:variable name="txpreview" value='<txp:page_url type="txpreview" />' />

Haha, love it. I just need to keep on churning out half-baked solutions and you come up with something better!

So what you are talking about is:

Not quite. As I understand the status is irrelevant in the (tx)preview (because the article is actually set to ‘draft’ or ‘hidden’), so you just need one article tag. Putting two in there will give you duplicate output again.


TXP Builders – finely-crafted code, design and txp

Offline

Board footer

Powered by FluxBB