Search the Community
Showing results for tags 'siblings'.
-
so I have a Profields Table on a sibling's page, trying to access it from its sibling's page (DUH!) which is $page now, cause that's where I am right now. I do $toc = $page->siblings("template=tableofcontents")->tableofcontents_table; $toc->render(); or $toc = $page->siblings("template=tableofcontents"); $toc = $toc->tableofcontents_table; $toc->render(); but it just won't work because Call to a member function render() on null The table clearly is there and clearly is a sibling and its template is as stated and the table also. Please help me quick, about to throw the computer out the window, thank you.
-
Just one of those things I often find myself wishing for: Could a future update add a "Siblings" list tab (or make a "Children & Siblings" combined tab) to /page/edit/? Save + Next is a godsend, but in many cases I need to jump around instead of cycling through. Sometimes I just want to reference how I titled other pages under one parent to keep the naming consistent. Other times I'm deep enough in my page tree that it's a half-dozen or so more clicks than I'd like to get back to where I was. So far my workaround is to right-click on the parent's name in the Breadcrumb nav, and open the page tree in a new tab. But when editing a site often has me opening ten or more browser tabs at a time, each one I can cut out is a blessing. Thanks for your consideration!
-
Was browsing the cheatsheet trying to pickup some new selector tricks and noticed the next all siblings selector. $page->nextAll($selector, $siblings) Introduced in Version 2.0 Description Return all sibling pages after this one, optionally matching a selector. $selector Optional selector string. When specified, will filter the found siblings. $siblings Optional siblings to use instead of the default. Based on the description above, should the following not return a pages siblings? <?php $solutions = $page->nextAll($siblings); foreach ($siblings as $solution){ echo " <a href='{$solution->url}'>{$solution->title}</a> ";} ?> It works if I drop the nextall and refer to siblings without the variable $ <?php $solutions = $page->siblings; foreach ($solutions as $solution){ echo " <a href='{$solution->url}'>{$solution->title}</a> ";} ?> Just curious really.
-
First the structure (offtopic, Structure reminds me of EE ) Home -Company Page --Section (template: container) ---Child page 1 (template: content) ---Child page 2 (template: content) ---etc. I have editors that can add pages to template container, but not edit the page. Problem is that they can not sort the child pages (template:content) by default. Solved it by adding a 'move-children' role that has move-pages and sort-pages permissions. The problem lies in setting that role and permissions to the template 'container'. You cannot select the 'Create Pages' checkbox for role 'move-children' unless you also give the 'move-children' role the 'edit-page' permission. (It's disabled) (I'm not sure if I'm using the correct terms...) Eventually I solved it by setting the 'edit-pages' permission to the 'move-children' role, checking all the boxes for the template access, and then removing the 'edit-pages' permission. I don't know if this is the intented behaviour but I thought I'd share it with you to see what you've experienced. Thanks
- 2 replies
-
- 1
-
- sort
- permissions
-
(and 2 more)
Tagged with:
-
Hello. I'm really enjoying going into ProcessWire after using Drupal, CodeIgniter and FuelPHP for a while. Anyway my first question is with this bit of code $items = $page->siblings("template=portfolio-item, sort=random, path!={$page->path}"); As you can see, I'm trying to get siblings of the page, excluding current one. But instead it returns ONLY current page, as if there was no exclamation mark in the path selector. What's the problem here? Update: Okay, have found solution here http://processwire.com/talk/topic/1230-limit-siblings-after-removing-page/ Still curious about path selector behaviour though.
-
Am trying to list 3 other events (siblings) at the bottom of an event page. My problem is I can only seem to limit before I remove the $page part meaning I end up with only 2 other events at the bottom of the page. Have tried the following but doesn't seem to work: $page->siblings->remove($page); $events = $page->siblings("limit=3"); I've tried various things but perhaps someone more knowledgeable could point me in the right direction? Thanks