Hello everyone,
I was wondering if there is a way to show more than just the page title in the subpages list. Our client would like to see his custom project number next to the project title. Any idea if this is possible?
Hello @rbnschlz,
At the moment, there is no way to do this that I know of other than to “hack” the panel.
This means having to look at the panel code that creates the pages list and adding a column with your custom project number.
Now that I think of it…
You could try this workaround (not very nice):
Create two title fields. title is the default and is used in the panel. page_title (or anything else you want to call it) is the actual title you’ll use in your frontend.
In title, enter the page_title and the custom project number separated by a comma.
Potentially create a custom field that does that automagically for you
I’m not proud of the potential workaround but if it suits you and your clients, it was worth sharing
@coreytegeler asked me something comparable for my subpagelist plugin a while ago. Although I didn’t want to implement a custom template (because I’m using the sidebar snippet as it is) I described how to modify my plugin to use a custom template as mentioned in this comment.
Maybe this is an option. It’s hacking a plugin instead of hacking core
Thanks, got it working for now.
I didn’t completely understand your proposed template.php file and deleted some of the if else statements since they were throwing an error. Code looks like this now:
The if-clause should check, if subpages exist and otherwise display a message. I had a short look at the plugin code and $field is not passed to the template.
@rbnschlz:
You can alternatively edit the content of the title field of all pages to add the project number there.
If you need you can drop that number within your PHP code!
Or you can use a separate field with the project number to sort your pages. In this case you see the number in the right column of your hardcopy.
Thanks,
I’d like to avoid having the number in the actual title field. Not exactly the best solution in my opinion.
How would I go about sorting the pages by a specific field? Thought about this as well but couldn’t find a proper solution.