Page 1 of 1

Hide blog pages?

Posted: Mon Nov 23, 2009 8:51 pm
by nealk
I have a friend who is using Serendipity for their blog. (I talked her out of using wordpress.)

She wants to start her blog over. (New theme.)

My question is: is there any way to hide old blog entries?
She'd rather not delete and start over, and she wants all of the old permanent links to work. However, she does not want these entries featured on the calendar, categories, search, or "previous entries".

Basically: if you know where the entries are (e.g., http://server/blog/index.php?/archives/7-guid.html), you can see them. But if you don't know that they exist, then they will be hidden.

Is there any easy way to do this?
(I'm also not opposed to hacking code to say "don't return results with IDs < 450" or such, or creating a plugin if someone gives me some hints.)

Re: Hide blog pages?

Posted: Tue Nov 24, 2009 12:08 am
by yellowled
nealk wrote:Basically: if you know where the entries are (e.g., http://server/blog/index.php?/archives/7-guid.html), you can see them. But if you don't know that they exist, then they will be hidden.
You could use registered users and the respective plugins to make these entries available for registered users only.

YL

Re: Hide blog pages?

Posted: Tue Nov 24, 2009 12:58 am
by stm999999999
nealk wrote: My question is: is there any way to hide old blog entries?
Can you tell us the reason for doing so?

reason for my question: perhaps she wants to achieve an aim, but has choosen an inaccurate technical solution? perhaps there is a smoother way.

Re: Hide blog pages?

Posted: Wed Nov 25, 2009 12:10 am
by abdussamad
Use the extended properties for entries plugin. Then create a custom field called hide. Set the value of hide to 'yes' for all the existing entries. You could probably do this via an SQL query if there are a lot of entries otherwise just do it manually.

Then in entries.tpl check whether its a single entry. If its not then check whether hide is set to 'yes' and if so skip the entry. If hide is set to 'no' display the entry. If its a single entry you display it regardless. That would do what your asking to do.

Re: Hide blog pages?

Posted: Wed Nov 25, 2009 6:27 pm
by nealk
abdussamad wrote:Use the extended properties for entries plugin. Then create a custom field called hide. Set the value of hide to 'yes' for all the existing entries. You could probably do this via an SQL query if there are a lot of entries otherwise just do it manually.

Then in entries.tpl check whether its a single entry. If its not then check whether hide is set to 'yes' and if so skip the entry. If hide is set to 'no' display the entry. If its a single entry you display it regardless. That would do what your asking to do.
Excellent. Thank you for the clear guidance.

With regards to stm999999999:
She wants to start a new blog, writing on a new topic/theme. However, she wants to use the old blog URL (http://server/blog/) and she does not want all of the old permanent links to break since people do link to her old blog entries.

The idea behind hiding the pages allows her to use the same blog URL and write new topics, but the old stuff still exists and the old links to the old stuff still works.

Re: Hide blog pages?

Posted: Wed Nov 25, 2009 11:38 pm
by Don Chambers
abdussamad wrote:Then in entries.tpl check whether its a single entry. If its not then check whether hide is set to 'yes' and if so skip the entry. If hide is set to 'no' display the entry. If its a single entry you display it regardless. That would do what your asking to do.
Using a similar approach, you could compare the entry's timestamp to a specific unix timestamp, such as November 1, 2009:

Code: Select all

{if $entry.timestamp >= 1257033600}
As with abdussamad's suggestion, single entry views would be showed all the time, but over view pages, such as author view, category view, archives, etc, would not include those older entries.