1

I know that content types can be extended using Extension Manager, but can the default content types be restricted so that they aren't available for non-admins?

For example, let's say I extend 'Page' and create a sub-type called 'Product Page', is there a way to hide or exclude the default page option when creating a new page so that editors can ONLY select the sub-type I've created?

EDIT:

Here is a bit more information: I've created several class extensions of "Page" (or modified existing extensions), such as "Home", "Information Page" and "Article Page". enter image description here

The circled type "Page" is the one I'd like to hide from users. per @Miguel-F in the comments below, I also created an extension of type "Page" with a subType of "Default" through the "config.xml.cfm" file. Back on the admin side, I went to Extension Manager: enter image description here

and modified "Page/Default". Here I selected "Yes" so that users can only use a specific subtype, and then deselected the "Default" option, choosing only the types I want my users to be able to use: enter image description here I've setup a test user who is not an Admin, and tried this out with that account, but when they go to add content, they get the same "Select Content Type" screen picture above, complete with the "Page" option I don't want them to have.

JesseEarley
  • 1,036
  • 9
  • 20
  • Are you asking about restricting subtypes under your new class extension or under the default page types? I know you can under the class extension by selecting the "Allow users to add only specific subtypes?" option. When you select "Yes" it will show a box of all available subtypes letting you pick and choose which ones you want to allow. See this for reference - https://groups.google.com/forum/#!topic/mura-cms-developers/nTm-O3ejyOA – Miguel-F Apr 26 '17 at 19:39
  • No, I'm asking about restricting (ie. hiding) the default types. So rather than allow my content editors to select the "Default" page type in the popup when they choose to add new content, they can ONLY see my "Product Page" type (which is a sub type/extension of the default page type). Does that make sense? – JesseEarley Apr 26 '17 at 19:52
  • I'm not sure you can do it per-user but you might be able to per-site. Try this, go to the Mura admin under Class Extension Manager. Click on the "Page / Default" class extension then edit that Class Extension. As I mentioned before, there is a section for "Allow users to add only specific subtypes?". If you select "Yes" it will show the subtypes. Select only the subtypes you want to allow. NOTE: if this works it will restrict the default Page content subtypes for the entire site. You can do the same for "Folder / Default" etc. The subtype of "Default" means the base Mura subtype. – Miguel-F Apr 26 '17 at 20:14
  • I should have mentioned, if your site does not have a "Page / Default" class extension you can create one. The key is to use the subtype of "Default". That tells Mura you want to override the base type. – Miguel-F Apr 26 '17 at 20:27
  • I've updated my original post with some more information, including what you stated to do, as it doesn't seem to be working. – JesseEarley Apr 27 '17 at 11:23
  • Did you try selecting "Inactive" for the status on the "Page / Default" class extension? The only other suggestion I would have is instead of trying to hide the default page type just modify it and/or it's display template to be the design you are looking for. Your "Page / Home" for example (or whichever of your new sub types should be the default page type). – Miguel-F Apr 27 '17 at 11:58
  • I hadn't, but I just did and tested again, no dice. The foal with attempting to hide it is that each of the types I've created has their own extended attributes that only make sense for their type. – JesseEarley Apr 27 '17 at 12:05
  • I'm guessing your only option then is to modify the "Page / Default" type to be one of your new types. You can assign whatever extended attributes you want to it. Although because it is the "Page / Default" I think any extended attributes you add to it will be added to other "Page" sub types as well. I will defer to the BlueRiver guys to help you here. – Miguel-F Apr 27 '17 at 12:13
  • You're correct, any extension of "Page" ends up putting all of the extended attributes for the extensions onto the default, which was really my main reason for wanting to hide/remove that option in the select content type popup. I can hide the first option with CSS...I'm just not sure if I can introduce custom CSS at the admin interface level to do so (still a relative newbie to Mura). – JesseEarley Apr 27 '17 at 12:15

2 Answers2

1

If you would like to go the route of hiding the default page content type via css or javascript you should be able to use the following gist created by Steve Withington as an example.

https://gist.github.com/stevewithington/82028081148217ada55b

John Sieber
  • 322
  • 2
  • 13
  • I tried this, reloaded my site (and the Mura application), and didn't see anything change. I don't see the script in the source either. Even just adding a test of trying to throw a JS alert yields nothing, so that code doesn't seem to be running. – JesseEarley Apr 27 '17 at 17:08
  • 1
    Actually, I see why it wasn't working, there were 2 conditions in the IF statement, one doesn't seem to be true at all for Mura 7. Removing the second condition made this work. Not sure if this is the best solution, but it works for now. Thanks! – JesseEarley Apr 27 '17 at 17:26
  • Can you point me at that line code so I can evaluate it for a core fix? – Matt Levine May 16 '17 at 22:05
0

The availableSubTypes attribute (named "Allow users to add only specific subtypes?" in the admin UI) defines available types for content children of a parent page with a specific type. The name is a bit confusing: availableSubTypes does not define a type's available subtypes.

So, if you are only using subtypes and you want to restrict available types everywhere, you have to add your list of available types for all your new subtypes, not just Page/Default (and actually it will not be necessary for Page/Default since you will not be using it).

Damien
  • 3,060
  • 1
  • 25
  • 29