Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-07-22 09:54:56

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

[Solved] 'Articles coming soon' - best practise request for comment

Hi there.
I’m finding increasingly that some articles I’m writing take me more than one sitting to write, or I have an idea for article that I want to write and make a blank article with the title set and status set to Pending. I’d like to take this a step further and give an indication of what I’m working on, ideally on the front end. This indication would be purely a title, no hyperlinks or anything like that, just a taster or what’s to come.

My understanding is that only live and sticky articles are intended for public consumption. Now, I can work around this by creating a speculative article with a future timestamp to prevent it being displayed in full, and use article_custom to fish out the future articles from the database. It’s possible that someone could figure out the article URL format from the title and this would reveal the whole article. I’d much prefer to serve a 404 error or holding page instead.

What’s the best method for handling upcoming-yet-hidden articles but giving some kind of indication that it’s coming soon?

As ever, thank you for reading and I am grateful for your input and suggestions.

Last edited by gaekwad (2013-07-22 10:28:58)

Offline

#2 2013-07-22 10:08:09

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: [Solved] 'Articles coming soon' - best practise request for comment

Another way I just thought of would be to set the status to Sticky while I’m writing it, then make it Live when it’s ready. Adding some voodoo into an article form to not display the article content if it’s Sticky would achieve what I want to do, but perhaps prevent me from using Sticky articles in future.

Offline

#3 2013-07-22 10:15:19

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

Re: [Solved] 'Articles coming soon' - best practise request for comment

Create a page template called private, with this as its code:

<txp:txp_die status="404" />

This will prevent anyone accessing the section, or its contents, where the template is used. Now create a section called soon, assign the private template to it, omit its articles from searches, frontpage and feeds.

Now you can save your upcoming articles to the soon section, no one can see their contents, but you will able to list their headings and what not:

<txp:article_custom section="soon">
    <txp:title />
</txp:article_custom>

Last edited by Gocom (2013-07-22 10:16:50)

Offline

#4 2013-07-22 10:28:46

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,356
GitHub

Re: [Solved] 'Articles coming soon' - best practise request for comment

Thank you, Jukka – a perfect solution.

Offline

Board footer

Powered by FluxBB