Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/19/2012 in all areas

  1. Today one of our (http://update.ch) latest PW project went online. Concept and desgin by partner company (http://p-inc.ch). Relaunch of the website for the design hotel The Omnia in Zermatt Switzerland. http://www.the-omnia.com - CMS: ProcessWire 2.2 - Multilanguage (separate tree) - Responsive Layout - Adaptive Images - Lots of images - Passwort protected Media Image download
    1 point
  2. Got it When creating a page in the API its default status is published, whereas items entered into a repeater in the API seem to be unpublished and hidden. As such, you need to do the following to each item in the repeater: $pageid = [your page generated via the API that contains the repeater] - must be saved before adding the repeater items in order to get the page ID $repeaterpage = wire('pages')->get($pageid)->repeater_field->first(); $repeaterpage->removeStatus(Page::statusUnpublished); $repeaterpage->removeStatus(Page::statusHidden); $repeaterpage->save(); The code above only does it for the first item, but for my needs each repeater is only being imported with a single item for now and other items will be added over time - if you had more items in the repeater you would need to iterate through them of course. Just needed some sleep and a morning coffee for this one I should have 600+ files imported from a third-party file management script by the end of the weekend now - just got a wedding to go to in the meantime else I'd have this all wrapped up by lunchtime I reckon
    1 point
  3. Very nice. Great work, thanks for sharing this
    1 point
  4. The page statuses are a bitmask so it's possible for there to be multiple statuses on a page, like unpublished and hidden. So it's best to add and remove statuses with the addStatus and removeStatus functions, i.e. $page->addStatus(Page::statusUnpublished); // same as: $page->status = $page->status | Page::statusUnpublished; $page->removeStatus(Page::statusHidden); // same as: $page->status = $page->status & ~Page::statusHidden; You can also check the status of a page by using the is() function: if($page->is(Page::statusUnpublished)) { ... } // same as if($page->status & Page::statusUnpublished) { ... }
    1 point
×
×
  • Create New...