Jump to content

Soma

Moderators
  • Posts

    6,808
  • Joined

  • Last visited

  • Days Won

    159

Everything posted by Soma

  1. If you had a page field with allowing multiple pages (PageArray) and changed it to allow single page later, there could be multiple still saved to the field but you only see one. Try changing it back to multiple pages and check if there isn't more than 1 selected in those on the page.
  2. I haven't used form builder with files upload yet, and I can't find any "file" field in formbuilder 0.2.0, maybe I'm missing something. An php array is accessed array[key] same as in Javascript or other languages. You can get the created like this: foreach($forms->get("contact-form")->entries->find() as $e){ echo "<p>{$e['e_mail']} - {$e['created']}</p>"; } If your 'file' field is itself an array you could try using echo "<pre>"; print_r($e['file']); echo "</pre>"; and you'll see the array printed out recursively and you see all the entries and its keys and values. Once you know the key you access it for example: echo $e['file']['filename'];
  3. $group = $page->widget_group; foreach ($group as $item) { echo $item->widget_group_name.'<br>'; // this works as I see the id# $widget_page = $pages->get($item->widget_group_name).'<br>'; // get the page using the id - doesn't appear to work? echo $widget_page->block.'<br>'; // Shows me nothing - (block is the name of a field on the widget page) } if "widget_group_name" is a page field you don't need to get the page, as you already got it! Though if that page field is set to multiple (PageArray) it would be always an array even if only one page selected in the field. So you'd have to threat it as PageArray and use first to get the first page selected. echo $item->widget_group_name->first->title Or if you change the page field to single page you can use echo $item->widget_group_name->title
  4. try print_r($group->getArray());
  5. Ryan the link on your module http://modules.processwire.com/modules/custom-page-roles/ ... points to this thread as project and support page, but the link has a comment id which might be not here anymore, so it fails loading the thread.
  6. See also this thread with hooks for page access rights: http://processwire.com/talk/topic/371-page-specific-permissions There's a PagePermission.module that has all the permission hooks set for reference you might look in there. All permission hook: $this->addHook('Page::editable', $this, 'editable'); $this->addHook('Page::publishable', $this, 'publishable'); $this->addHook('Page::viewable', $this, 'viewable'); $this->addHook('Page::listable', $this, 'listable'); $this->addHook('Page::deleteable', $this, 'deleteable'); $this->addHook('Page::addable', $this, 'addable'); $this->addHook('Page::moveable', $this, 'moveable'); $this->addHook('Page::sortable', $this, 'sortable'); So most simple and basic delete module would be an autoload module as Wanze mentioned. //... public function init() { $this->addHook('Page::deleteable', $this, 'deleteable'); } public function deleteable(HookEvent $event){ $page = $event->object; if($page->id == 1001) { $event->return = false; } } So if on page with id 1001, there would be no delete function. $event->return should either be false or true and you can do all sorts of checks, for roles, users, permission, shoe sizes...
  7. I'm not sure if repeaters would work as they're somewhat special.
  8. On mobile so short. Yes you have to remove or edit the fields name restriction check in the hook function for the multi select. Line 59 in module. It's hard coded and also other hooks i was experimenting are commented out. Back on laptop https://github.com/somatonic/PageReferenceLink/blob/master/PageReferenceLink.module#L59 ... screw it I just updated it and commented out the check so all InputfieldPageListSelectMultiple fields will have an edit link. This module is just experimental prototype but working and a start.
  9. mydomain.com/login/page/edit/?id=1011 ... is /login/ you PW admin/installation? It's just I'm not sure where template files would be involved in backend editing? This is not possible I think. What fields are they? What data do you enter extactly? The only scenarion that comes to mind is that you enter some data in that last field that is suspicious and maybe some security setting on server does not allow for posting those through a form and you get a 404... But maybe not. Ok seeing the modules list, try deinstalling some of those like Process Page Dele, Modules Manager, HTML Purifier?
  10. What are you missing again? Paths prefixes? you mean like /de/... /en/... ? Those are set on the homepage name.
  11. Yeah that is because it turns on "modal" mode in the system. It's quite tricky/hacky and I don't consider it stable One side effect is the one you mention after install, but if you reload the refresh the admin url or clean out the &modal=1 (not sure anymore) you should see the Pages screen normally as before.
  12. Something like this? https://github.com/somatonic/PageReferenceLink I have started this module long ago but didn't come to finish it and just pushed to github. If someone likes to help out as I'm busy with other projects this could be taken and improved with settings and what not. Or Maybe it is of use for Fredi.
  13. Replace only wire folder and do clap your hands two times. Done.
  14. Ah when saving the page? Of course if you provide more infos so we could reproduce we may be able to know whats going on. And what does the template code have to do with it?
  15. PW fields have nothing to do with 404. Its a page not found error page that always comes from when entering a url that does not exist or is not viewable.
  16. Yeah nothing special here with get and selector that is not explicit calling a page, it behaves like a find with limit=1. The sorting is something I wondered too, sometimes you have to define sort=sort to get the manually sorted (also with find()), but then it's all normal and behaves as it should. Behind the scenes $pages->get(selector) will call $pages->find() at the end. You can also use $pages->findOne(selector) and will return the first matches page and return a Page not PageArray.
  17. $page->find() or $page->get() does nothing... however if you use a selector in get(selector) it behave different and return first found entry and it's not specific, so include=all or include=hidden will have a effect. But I meant $pages->get(id) or $pages->get("/path/") is explicit and will get the page regardless of it's state, it's a explicit API call.
  18. Grüezi Daniele, you will get access to the form builder support forum once Ryan sees this. I'm not sure what you need to archive, but since the entries are stored as json you can't search for entry fields. If you want to use API to find entries you need to store them as pages. You can access the entries in DB through $forms foreach($forms->get("contact-form")->entries->find() as $e){ echo "<p>{$e['e_mail']}</p>"; }
  19. get() will get the page regardless of its status. It's a explicit call. $pages->get(5766) will always get the page with id 5766 whether it's hidden unpublished or red or blue. So include=hidden won't do anything here.
  20. I pushed update to github pages, but it's still not updated... give it some time...
  21. Just updated Captain Hook to 0.2 with latest dev version (+14 new entries) Enjoy
  22. @marty, just read this and I thought you don't use images in RTE? However I think with my ImagesManager it would be easily possible to add a image from thumbnails... {image=1023, thumbnail=small}
  23. ... and end up in endless loop land. ;-) Better just save the field only $item->save('sort_title') so the hook doesnt get called again and again and...
×
×
  • Create New...