I’m using a structure field to get an overview of my website and manage categories.
I can create a new row that is a new category.
In the second column of that row, I would like to display the corresponding projects.
So I though about a query that would match the title of that category, but it seems out of bound for a query.
Maybe something else?
Something like :
query: site.find('title of the action in that row')
I’m bumping it,
since I would really like to find a way to do it.
Also, maybe it woud be simpler to do another one, linked to the first idea :
I would like to be able to select a category for a project in the panel, using the type: select
And at the bottom, display all the items with the same categorie as the one selected in the dropdown.
Maybe it’s a bit complex to make it without reloading the page though.
You are trying this inside a structure field. So the challenge would be to fetch the action of the right item in your blueprint, which is impossible.
The only way this could work on the blueprint side would be if you save first and then write the result to file using a hook.
This is probably not what you want. So you would have to do this in the Panel Vue part, with a custom (structure) field where the second field listens to the first.
If this is supposed to be an overview of your site, wouldn’t it make more sense to either use an info field that calculates all that and displays a table? Or even a custom panel area with a list/table. I don’t really see the advantage of trying to do this in a structure field. Might be missing something.
Alright, but what if we put aside the table and structure field and that I focus on the fact that I would like to show, on a project page, the articles in the same category as the one selected for the project ?
Alright! I’m starting to understand! haha. Thank you.
I thought it would have been possible to show a page without formatting an info field but just by using a pages one.
Since custom page methods are pretty new to me, I checked the doc, but you code doesn’t seem to belong in /plugins/page-methods/index.php right?
A pages field is a specialized (multi)select field. Like a select field, it gives you options from which you can select pages, only the selected ones are then stored in the content file and shown in the list.
An alternative to using the info field could be the pagesdisplay section plugin: