Menu placement for custom apps

  • Lots of times apps we create aren't necesarrily targeted to content editors but rather admins of the site and all those extra apps in the "My Site" menu can be confusing and cluttering for content editors (which seems to me to be contrary to the main Perch philosophy) It would be ideal if when configuring an app, we could configure which sub nav menu the different pages of the app could appear in.

    Ex: I may have an app that has one page which is intended for content editors so, yes, i want that to be configured under the sub nav "My Site", but in the same app, there may be a configuration page that i would want to be placed under the "Settings" sub nav, normally i say, yes put the configuration as a Perch setting, but I find it can often get more complex than just a simple setting and a custom built configuration page for the app is required.

    Any idea if this could be considered for a future version ?


  • I like the idea of having tabs in the settings menu, as it would make thing simpler when you have multiple apps installed. However in the mean time you should be able to set permission on subnav items so you can hide the custom settings page from certain user groups.

  • Yeah what i do presently is to add a smart bar with tabs, one for the main content and depending on permissions, add a configuration tab something like:

    You see here the integrations tab only shows for roles with that permission, but ideally, i would like to take it out of the CMS content managment and place it under settings adding a new item where the arrow indicates. because the integrations are not about content but how the app behaves.

  • I have no strong opinions regarding what you're suggesting. A sub-page within the app can be restricted to certain users as Byron Fitzgerald pointed out.

    I did find the Perch Settings limiting once and had to build a custom configuration page for an app. Then I realised only a developer would need to access and modify these settings, and all I really needed was a single PHP file that returns the configurations in an array. And even for simple configurations: if it is something only a developer would need to access/modify, a constant in the Perch config file is enough.

    I'm not saying that's true for all cases, but it is worth considering.

  • Ok how about this. I have an app that doesn't deal with content at all, rather event notifications. I don't want it to be shown within the MySite menu because it has nothing to do with content and a content editor would not need to use it. But i can't place a link to it anywhere else. It would be like if the backup app which is available from within the settings sub nav was a user contributed app and was placed within MySite rather than Settings. It doesn't make sense there.

    I feel like often the assumption is that any user who is not the developer of the site is either not able or not concerned with the site management. I think its dangerous somewhat to make this assumption because for one its simply just not true. I have clients who do use the backend, manage users and roles even though they are not developers as new members are onboarded at their place of work. Being able to place an app into different menu item locations is not a huge request i don't think especially since there's a class and function that builds the menu. it could easily append extra items depending on a unique menu key. It would also open up options for better custom app integration into perch and since it looks like Drew is looking to do less on the app front and more on the core, allowing us to hook into these menus to add items would seem to make sense to me.

    Just my opinion here.

  • Whilst I still agree that being able to have a settings area separated from the app it self is a good idea, it sounds like most of what you want to do is already possible using the current permission and app registration methods;

    1. $hidden = !$CurrentUser->has_priv('perch_app_example')
    2. $this->register_app($app_id, $label, $priority=10, $desc, $version, $hidden)

    Or alternatively if you are using runway you can add permissions with the menu manager.

  • I feel like often the assumption is that any user who is not the developer of the site is either not able or not concerned with the site management.

    That's a little far from my point. To clarify, I don't think there's anything wrong with a UI to manage the app's settings even if only a developer would use it.

    Though there are settings that only a developer would change. For instance, I wrote an app that generates JSON file(s) containing keywords so the JSON can be used to provide search terms suggestions as the users type in a search box. I have a PHP file in which I can specify which Collection(s) I'm targeting, the keywords field ID, the template path and some filters. A simplified example:

    It is not impossible to build a UI for the above, but I don't think it is worth it. I can be certain the admins of the control panel won't need to worry about modifying this.

    To reflect your feeling, I feel you're thinking about your use case more than the point I've made in my previous comment ^^! To summarise my previous comment:

    • explained an alternative approach to handling custom app's configuration (a little off-topic I must admit)
    • said it is worth considering (in case it is ideal for your use case)
    • admitted it is not a good solution for all use cases