101Bram
-
Posts
11 -
Joined
-
Last visited
Posts posted by 101Bram
-
-
7 hours ago, BillH said:
Another possible approach, given $subchildren as the result of your find:
$parent = null; $grandparent = null; foreach($subchildren as $subchild) { $scParent = $subchild->parent; $scGrandparent = $scParent->parent; // Or $subchild->parent->parent if($grandparent != $scGrandparent) { $grandparent = $scGrandparent; echo $grandparent->name . '<br/>'; } if($parent != $scParent) { $parent = $scParent; echo ' ' . $parent->name . '<br/>'; } echo '  ' . $subchild->name . '<br/>'; }
Obviously, this'll produce simple indented text, but you could adapt to generate a list or whatever you need.
If I can force the subchildren to be ordered by parent / grandparent, I really like this idea!
-
Maybe my question was not completely clear, but I have a selector to find all the grandchildren.
The question is how I can output the structure
-
parent 1
-
child 1
- subchild 2
-
child 1
-
parent 2
-
child 1
- subchild 1
- subchild 2
-
child 1
when these highlighted pages are the result of my selector.
-
parent 1
-
I have a simple hierarchy in my pages:
-
parent 1
-
child 1
- subchild 1
- subchild 2
-
child 2
- subchild 1
-
child 1
-
parent 2
-
child1
- subchild 1
- subchild 2
-
child1
-
parent 3
- ....
I want to display all the subschilds that are satisfying some conditions, and I can do it with a really efficient selector.
e.g (pseudocode)
sub_childs = page.find(template='subchild', parent.title='child1', parent.parent.location='US', ...)
I want to format these results with their parents, e.g. if the highlighted childs are selected in the query, I want to output:
-
parent 1
-
child 1
- subchild 2
-
child 1
-
parent 2
-
child 1
- subchild 1
- subchild 2
-
child 1
Is there a simple way to achieve this with only using the 1 selector?
-
parent 1
-
Didn't know it was that simple, I really overcomplicated it with apache configurations and so. You made my day!
- 1
-
The problem is I don't use php except for calling the API.
My guess is if I go to website.com/pw_api/some_template/, Apache first looks for the file index.php, processwire is initialized and handles the route. Without the index.php the url /api/some_template doesn't have any meaning for the server.
-
Hey,
I'm using processwire as a backend service (as a REST API to be more specific). I would like to let my server point at my index.html file (It is not possible to change this to a php file for many reasons), but without the index.php processwire won't work. Can processwire be used if I for example move the index.php file to a subdirectory?
Kind regards,
Bram
-
Hey all,
a very noob question I guess. I have a structure like this:
-
Page 1
- Images_list (variable number of images)
- Uploader
-
Page 2
- Images_list (variable number of images)
- Uploader
- ...
Does there exist a selector giving me images 10-20 with the name of the uploader for each image, without looping over the images again to find the uploader?
-
Page 1
-
Thanks!
-
Hey,
is it possible to use one account for all users? On a wedding users will get the same password which they can use to see wedding photo's. It's a very basic kind of protection, but it will be enough. I am only worried that 3 users can not be logged in on the same time with 1 account.
-
Hey all,
I want to add users to the website (using the backend user page), and create a specific user page for them automatically. That seems not to hard using hooks.
But then I want to give them a link to the automatically generated page, so they can edit that page for themselves, and I don't really know a way to do it.
Can someone help me out?
ps. The use case is an election page, where I can add a person, and the person can edit his own motivations. I only want to register the persons emailadress in processwire, and the person should be able to edit his information on his own page.
How to group filtered grandchild pages by parent title?
in Getting Started
Posted
Awesome, thanks!