Using menu data sources, for instance getMenu, getMenuBranch or getSubMenu, is there a way to get the name of the page template used for each menu item?
Using the same data sources, there are attributes owner and modifier for each menu item. How to map those hashed values / ids to users from the user store? I would like to know the username or display name of that user.
I am afraid I must disappoint you on both questions here. At least for data sources. There are no data source that can help you with this information.
As far as finding the name of the page template, there is no way you can do that at all, through the portal. I guess we just never thought any developer might need that, so the only way of getting that information is by connecting straight to the database and using direct SQL, which I would not really recommend.
The function you create, can use a com.enonic.cms.api.client.Client, normally in the form of a RemoteClient, which has methods for getUser and getUsers. These will return all the information you need about the users you ask for.
Bjørnar is right here. The getMenuItem data source returns an XML that includes a line like this: <page key="18" pagetemplatekey="4" pagetemplate="Document" pagetemplatetype="5" />
This is the same for both Java API and data sources.
So, I guess the recommendation is to create a Function Library where you fetch the menu Item through the Java API (RemoteClient), parse the XML to find the users and look them up through the same Remote Client. Then put together a custom XML that you return to the data source and use in your XSL.
Thank you for your response. Our use case is actually not for developers, but for super users / editors. They wanted an easy way to know certain information about the site / menu items. The page template being used, as well as the user which created/modified it could be useful.
We might try the plugin-solution, given that this is important enough for us to invest the extra few hours developing the plugin.