autoPublish Date feature

9 posts by 2 authors in: Forums > CMS Builder
Last Post: October 28, 2010   (RSS)

By Dawna - October 28, 2010

I need to add the special fields for publishDate and removeDate to one of the CMS pages we're using for a blog here: http://www.life-benefits.com/blogList.php

I added these special fields in the section editor but as I test them on a new entry the content is instantly published and viewable rather than obeying the publishDate field.

I must be missing something in the process of adding this special field but I'm not sure what. Can you help me go over the basics that I might have missed? I've read all the other posts related to this topic and it seems like I'm doing it correctly. :-/

Re: [Dawna] autoPublish Date feature

By Jason - October 28, 2010

Hi Dawna,

First thing to check is to make sure that the fields are named exactly right as they are case-sensitive (ie, publishDate). After that, the publishDate will only work if a value has been set, if it's blank, it will publish. Try setting the date to a day or so in the future and see if that works.

If your still experiencing a problem, please attach the .php file that you're working with so I can take a closer look.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] autoPublish Date feature

By Dawna - October 28, 2010

Once I add the publishDate and revmoveDate fields in the section editor do I need to add code to the .php template page for it to work? Are there any other fields that would would conflict with these newly created ones?

Re: [Dawna] autoPublish Date feature

By Jason - October 28, 2010

Hi,

There shouldn't be any conflicts that would give you the results you're describing (ie, the page publishing regardless of the date).

You shouldn't need any special code either so long as your using the getRecords function. When I go to your site, I'm assuming that the post I'm seeing is the post you're trying to hide with publishDate. Is that correct? What is the publishDate value for that record?

It is important to note that publishDate uses your server's date/time, not your local computer's time. So if the date/time of your server is ahead or behind your own time, you may be seeing a difference in when things are publishing. A good check to see if things are working is to give the record a publishDate that is several days in the future to see if it still appears.

Let me know and please attach your .php file so I can take a look at the code

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] autoPublish Date feature

By Dawna - October 28, 2010

I checked the server/date and time and in the CMS general settings it shows the correct local time.

Maybe I'm not using the get Records function?

I have two pages for the blog...a details page and a list page.

What I've done to test whether or not it's working is I've added a record titled "test". It publishes even if I put it out 3 days in the future. I've deleted the test record when it posts since the site is live.

I know there's something simple here that I'm missing. I've used these special records fields before and they've always worked like a charm.
Attachments:

bloglist.php 11K

blogdetail.php 10K

Re: [Dawna] autoPublish Date feature

By Jason - October 28, 2010

Hi,

Your code looks correct. If you could email your CMS login and FTP details to jason@interactivetools.com I can take a look at the back end and see what is going on.

Please only email this information, don't post it to the forum.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] autoPublish Date feature

By Dawna - October 28, 2010

I sent the e-mail with that info. Did you get it?

Re: [Jason] autoPublish Date feature

By Dawna - October 28, 2010

YOU ARE A ROCKSTAR GENIUS!