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: [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: [Dawna] autoPublish Date feature

By Jason - October 28, 2010

Hi Dawna,

This was an interesting one. Everything in the CMS was set up correctly.

What was happening is that at the top of your pages, the code to include the viewer_functions.php file was searching in D:/(virtual_drives). Although it was finding a file, it wasn't finding the file we were expecting. I'm not exactly sure what it found. I replaced this code with this:
require_once("cmsAdmin/lib/viewer_functions.php");

After that, it was properly recognizing the proper fields. I've updated the record that you had already on there so that they would display.

A correction from my earlier post. If publishDate is left blank it WILL NOT publish, it will be hidden. Going forward what you're going to need to do is to either set the remove date into the future OR check the Never Remove check box to have your post display.

Take a look and let me know if you run into any other issues.

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

YOU ARE A ROCKSTAR GENIUS!