Search the Community
Showing results for tags 'published'.
Found 4 results
Hello! I searched a lot to find various solutions to the problem of setting a custom publish date. Which is a must if you do a redesign of a website and need to write import scripts. Since I can't re-use the database. I understand that there is no field to set the dates for created/modified/published manually, but this should be at least possible with the page API. So I tried to set the published date via API: $page->of(false); $page->published = 1486297829; $page->save(); Which did not work, whenever I ask for $page->published, I get the date back that was first set when publishing the page. So I researched a little more and found that the Page class stores the published date in $page->settings['settings']; (see Github) I also tried $page->set('published', 1486297829); but with no success. Is it possible that this has to be done via SQL? Why? Why can't I use the API? Or do I miss anything? Thank you a lot in advance!
Hi All, I have created a script which will create the pages and it should be unpublished. I have added the status as unpublished by default while first time saving the page as below. $hotelPage->hotel_website = $hotel['hotelWebsite']; // By default page created will be unpublished state $hotelPage->addStatus(Page::statusUnpublished); $hotelPage->save(); $hotelPage->setOutputFormatting(false); // Add hotel images only after setting output formatting to false $hotelPage->images->add($hotel['hotelImage']); $hotelPage->save(); On the same time, saving the hotel image as well and triggering the save method. But when I see the created page in the tree, Its shows unpublished but publish_date is not empty(date will be present as created, modified and published are all same) Now I don't understand why the date is getting filled into the publish field for a page? Please let me know if am doing something wrong.
I am currently running the Processwire 3.x branch (specifically 3.0.36 at the moment) and am back-porting data from a previous website that was created back in 2010. In trying to provide seemingly accurate publication dates to the older articles that I'm manually porting, I was thinking of adding a `published` field to the pages. Upon closer inspection I found that all pages do indeed have a `published` field already (in this version of ProcessWire anyhow). I suspect it was added to core back when ProDrafts was created. I see that there's a module to handle the ability of providing this field to all pages. http://modules.processwire.com/modules/publish-date/ I'm not sure if this is necessary now though if all pages already have an associated `published` date field? Would a module need to be created to expose this database field to the admin side, or is there another way to do this? Would modifying this field cause any detrimental side-effects (I do own a ProDrafts dev license, though am not currently using it in this project).
Hi, I've just upgraded a site from 2.6.1 to 2.7 and have noticed that the 'published' date does not seem to be working on new content I publish. Under the settings tab the info looks like this: Published on [?] If I try to output the date anywhere it comes out as: 1970-01-01 01:00:00 Does anyone know why this may not be outputting correctly?