Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
Re: previewing draft articles
We has it too :-)
<txp:variable name="txpreview" value='<txp:page_url type="txpreview" />' />
Offline
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
Online
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
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
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