Jump to content

Search the Community

Showing results for tags 'status'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 8 results

  1. I am trying to get some sites to remain in Unpublished status until certain conditions are met. However, I have a problem with the message ProcessPageEdit: Published Page. Overall, wire()->addHookAfter("Pages :: saved") seems to work for existing pages. And I can put them into Unpublished status whenever I want after I have saved them. But when creating a new page, the order of events is different. The newly created page is set to Published status when someone clicks Publish in the second step of the page adding process. But it runs after my code. How to solve this problem? Is there any documentation about the order of events?
  2. 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.
  3. I've got this code to fetch all pages: /** @var PageArray $pages */ $pages = $this ->wire('pages') ->find(sprintf( 'has_parent!=2,id!=2|7,status<%s', Page::statusTrash )); With this I fetch all pages except admin, but that includes the 404 page as well. Is there a way to exclude pages like the 404 page from the result? Or maybe loop through the result set to check for the pages response code (without curl that is)? I want to avoid filtering the 404 page by ID if possible.
  4. <?$work_pages = new PageArray();?> <?$project_1 = $pages->get("parent=/work/projects, limit=1, sort=sort"); $work_pages->add($project_1); // Code for Project 1 goes here $project_2 = $pages->get("parent=/work/projects, id!=$work_pages, limit=1, sort=sort"); $work_pages->add($project_2); // Code for Project 2 goes here $project_3 = $pages->get("parent=/work/projects, id!=$work_pages, limit=1, sort=sort"); $work_pages->add($project_3); // Code for Project 3 goes here // etc I have the above code which gets project pages then adds the project to an array to exclude from the next selector. I'm sure this was working fine but seems to have started including unpublished pages - if I unpublish or hide pages they still show up. I've done some troubleshooting and have excluded any caching issues - the code is definitely pulling in unpublished pages. Working on Processwire 2.8.35.
  5. I want to make a little module that tracks pageviews. This is my first module. I'm starting with a copy of helloworld.module. I already created the template pageviews and pageview manually, but I'll add their creation into the module later. Here's what I have: public function viewTracker($event) { $page = $event->object; // don't add this to the admin pages if($page->template == 'admin') return; if($page->template == 'vessel') { $r = new Page(); $r->template = 'pageview'; $r->parent = wire('pages')->get('/viewtracker/'); $r->user = $user->name; $r->vessel_id = $page->id; $r->name = $user->id . $page->id . date('YmdHisu'); //$r->status = $r->status | Page::statusLocked; $r->save(); } // add a "Hello World" paragraph right before the closing body tag $event->return = str_replace("</body>", "<p>Hello $user World!</p></body>", $event->return); } but the $user variable isn't coming through. How can I access the logged in $user? Edit: Got it. Replaced the $user with $this->user..... public function viewTracker($event) { $page = $event->object; // don't add this to the admin pages if($page->template == 'admin') return; if($page->template == 'vessel') { $r = new Page(); $r->template = 'pageview'; $r->parent = wire('pages')->get('/viewtracker/'); $r->user = $this->user; $r->vessel_id = $page; $r->name = $this->user . $page . date('YmdHisu'); $r->status = $r->status | Page::statusHidden; $r->save(); } }
  6. Hello, I need to find a good way to check for the status of a page, whether it is unpublished or not. If I do echo $page->status I get these values: published: 1 unpublished: 2049 hidden and published: 1025 hidden and unpublished: 3073 My page is hidden by default. So to check for unpublished state I do if ($page->status == 3073) which is working fine. Only thing that worries me is that I know nothing about these status codes and whether it will always be 3073 for hidden and unpublished. So if you know a more generic way of doing this, please share it here. Thank you. Cheers gerhard
  7. Hello As I said in my first post, I come from Textpattern. It has a great feature I not sure if PW can do it. What I want is select several pages and change theirs status at the same time. For example, I select five pages (articles in TXP) through checkboxes and then I chose the status to hidden (unpublish) or published. That way, we'd save a lot of work / time doing one by one. I mean do it in the admin side. My questions is: Is it possible to do it in PW or is there some module for this purpose? Thanks Fernando
  8. Hi there, I really want the status of the album-category page to be 'unpublished' but if I do that, the following doesn't work: $pages->get('/album-category/')->children Is this the expected behaviour? Thanks.
×
×
  • Create New...