ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Close down a whole weblog?

September 09, 2008 9:07am

Subscribe [3]
  • #1 / Sep 09, 2008 9:07am

    chabbs

    12 posts

    Is there a way to close down a whole weblog without having to delete it? What I want to do is close all the entries and then go back and open a select few. This weblog has several hundred entries and I don’t want to have to shut down each entry manually.

  • #2 / Sep 09, 2008 9:35am

    Mark Bowen

    12637 posts

    There are a couple of ways of doing this. One would be the EasyOpen extension although be careful with that as I think it stops you from deleting posts using the drop-down menu on the Edit page. Easy enough for what you want though. Just get a list of all the entries to close and close them and once finished just turn off the extension.

    Another way would be using a SQL query although you obviously need to be more careful running these types of things.

    Alternatively you could always just hard-code the weblog tag to only bring back the entry_ids that you want to see and that way you don’t have to change any status at all.

    Something like this :

    {exp:weblog:entries weblog="default_site" entry_id="1|12|14|45"}
    <h2>{title}</h2>
    <p>{body}<br />
    {/exp:weblog:entries}

    Obviously you will need to find out the entry ids of your own entries that you want to show but this might be another way of going about it? Another alternative would be to create a new status instead of just Open and Closed and then change the entries you want to show to that status and then provide the status=”“ parameter in a weblog tag instead.

    All valid ways of going about it really just depends on which you prefer.

    Hope that helps a bit.

    Best wishes,

    Mark

  • #3 / Sep 09, 2008 11:33am

    Ryan Irelan

    444 posts

    I’m offering this query up as a possible solution but want to preface it by saying that you should back up your data first and test this against a non-critical database before trying it on your real data.

    It will set all entries to a status of ‘closed’ for whichever weblog_id you specify:

    UPDATE exp_weblog_titles SET status = 'closed' WHERE weblog_id = 1;

    Change the weblog_id = 1 to whichever weblog you’re looking to affect. You can do this within the SQL Manager in the Utilities section of the CP.

    But again, please back up your data first and use at your own risk.

  • #4 / Sep 09, 2008 11:47am

    chabbs

    12 posts

    Thank you very much for the replies.

  • #5 / Sep 09, 2008 11:52am

    Mark Bowen

    12637 posts

    No problem. Let us know how you get on.

    Best wishes,

    Mark

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases