Jump to content

fbg13

Members
  • Posts

    344
  • Joined

  • Last visited

  • Days Won

    1

fbg13 last won the day on June 24 2017

fbg13 had the most liked content!

Recent Profile Visitors

5,595 profile views

fbg13's Achievements

Sr. Member

Sr. Member (5/6)

398

Reputation

  1. Figured it out... seems like I have to get the role again and turn of output formatting ... $page_ = wire()->pages->get("template={$name}_blog, name={$name}"); if (!$page_->id) { $page_ = wire()->pages->add($template_, "/", ["title" => "{$blogName}", "name" => "{$name}"]); $page_->save(); } $role_ = wire()->roles->get("{$name}_blog_editor"); if ($role_->id) { $role_->of(false); $role_->save(); } }
  2. I'm trying to create a site with multiple blogs, run by different users. Each user only being able to see and manage to their blog. For each blog I create a role, a template, an user and a page. I'm creating everything through the api and only one thing doesn't work. When I login as one of these users I can't see the page (in the pages tree in the admin dashboard) set up as their blog root. But if I go and edit role assigned to the user and just click save (no other changes) then the page appears after a refresh and I can edit it and add child pages. Here's the code What am I doing wrong?
  3. Try falkon and qutebrowser.
  4. Cause you're not closing your divs correctly. You open 5 divs and only close them all when there are replies, if there are no replies you only close 4.
  5. Also check https://github.com/processwire/processwire-requests/issues/106#issuecomment-429644472
  6. Disregard my comment, I didn't take some things into consideration. Should have made it clearer what I meant though: "Considering the drawbacks I listed, i don't think the functions API should be the default".
  7. https://processwire.com/docs/start/api-access/
  8. Which regular templates do you mean? A new template contains only the title field and doesn't return anything until you create a template file and tell it to return (echo) something.
  9. You can get all fields of a page, that are editable by the current user, like this: $p = wire("pages")->get(5994); foreach ($p->getFields() as $pField) { foreach($p->getInputfields($pField->name) as $inputfield) { if(!$p->editable($inputfield->name, false)) { continue; }; // need tracy debugger for bd bd("is editable: {$pField->name}"); } } https://github.com/processwire/processwire/blob/96f62b313fca3f48df0521096145b782fa08c0e3/wire/modules/Process/ProcessPageEdit/ProcessPageEdit.module#L815 https://github.com/processwire/processwire/blob/96f62b313fca3f48df0521096145b782fa08c0e3/wire/modules/PagePermissions.module#L118
  10. @MarkE Have you seen the access tab on templates and fields? https://processwire.com/api/user-access/ and maybe https://processwire.com/blog/posts/building-custom-admin-pages-with-process-modules/
  11. public function matches($selector) { // This method implements the WireMatchable interface return $this->comparison()->matches($this, $selector); } @bernhard I think $this->comparison()->matches($this, $selector) is PageComparison->matches(Page $page, $s) which doesn't accept an array, it only checks for a string or int and a selector, else returns false.
  12. $p = new Page(); $p->template = 'template_name'; $p->parent = $pages->get('/about/'); $p->name = 'mynewpage_url'; $p->title = 'My New Page'; $p->save(); Edit the page $p = $pages->get('/about/mynewpage_url/'); $p->title = 'My New Page (updated)'; $p->save();
  13. Check out devilbox. I just installed php on my system and use that one. Here is how to use the php inside the docker container.
  14. I don't have a wireless printer nor a scanner so can't help with that. Maybe this will help with the wireless printing https://www.makeuseof.com/tag/setup-wireless-usb-printer-linux/
×
×
  • Create New...