Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
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: 5,053
Website GitHub

Re: previewing draft articles

We has it too :-)

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

Offline

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,269
Website GitHub

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: 9,011
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,011
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
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