We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Extension: Hidden Templates in Pages/Structure

Development and Programming

Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade

Extension: Hidden Templates

I just wrote a quickie extension that hides Hidden Templates (prefixed by “.”) from the dropdown in both the Pages and Structure Modules. We’re using it to keep the publish form clean for clients and to keep them from accidently choosing say “includes/primary_nav” for a new page. We now are showing only a few templates like “site/two_column” and “site/three_column” which our clients really dig.

It requires the JQuery for Control Panel to be enabled. So far it plays well with a bunch of other extensions/modules, but let me know if you hit a snag.

Tested on EE 1.6.6.

UPDATED: Current version 0.9.6 Download it right here.

New Features: Added settings to enable/disable for Super Users and non-Super Users.

       
Ryan Irelan's avatar
Ryan Irelan
444 posts
16 years ago
Ryan Irelan's avatar Ryan Irelan

Seems to be missing the language file (the Settings link throws an error) and I’m still seeing the hidden template in the Pages module drop-down. Maybe I’m doing something wrong? Running EE 1.6.6 and PHP 5.2.3.

I’m happy to help test any fixes.

       
Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade

Extensions aren’t required to have a language file if there are no settings, so i disabled the settings link. However i’m going to add a per-user group feature so Super Admins can see all templates if need be, etc.. for the 1.0 “release.”

The file is updated.

As for it not working, do you definitely have JQuery for Control Panel enabled?

       
Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade

Update: added new feature:

Now has settings to enable/disable for Super Users and non-Super Users.

Hope someone finds this useful!

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

@Jack McDade great idea for an extension. I’m still seeing the hidden templates as well as a super admin, but with the setting turned on to hide them. I definitely have jQuery working as other modules are using it.

       
Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade

are you using the “.” prefix or “_”? Right now it only works with the default period “.” If that’s not the case, check to make sure the javascript is being inserted to the control panel – it should be the last thing before the </head>.

       
Ryan Irelan's avatar
Ryan Irelan
444 posts
16 years ago
Ryan Irelan's avatar Ryan Irelan

Thanks for the update. I do have JQuery for the Control Panel (v1.1.1) enabled but it’s still not removing my .something template from the Pages module template list. Maybe I’m doing something wrong? 😊

       
rockthenroll's avatar
rockthenroll
485 posts
16 years ago
rockthenroll's avatar rockthenroll

Default using “.” Not seeing the javascript right before the end. The last thing in my install is the Structure javascript.

       
Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade

@rockthenroll and @Ryan Irelan – what other extensions are you guys using? it could be a hook priority problem. I tried on a few of my other installs and it works everytime.

       
Ryan Irelan's avatar
Ryan Irelan
444 posts
16 years ago
Ryan Irelan's avatar Ryan Irelan

I disabled all other extensions except JQuery and Hidden Templates. This is a fresh install of EE 1.6.6.

So, with the extension enabled, I should be able to go to the Pages tab of an entry (or create a new page) and the .something template should be hidden from the Templates drop-down. Is that correct? I want to make sure my expectations are what the extension is actually meant to do. 😊

I also get the JQuery code in the header, so that seems to be working properly:

Edit: Bah, the forums stripped that code, oh well.

       
Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade
So, with the extension enabled, I should be able to go to the Pages tab of an entry (or create a new page) and the .something template should be hidden from the Templates drop-down.

Yup that’s exactly what it does. I’ll launch up a fresh copy of EE and see if that’s playing a factor. Most likely something very simple, as most things are 😊

       
Jack McDade's avatar
Jack McDade
425 posts
16 years ago
Jack McDade's avatar Jack McDade

Looks like i have to go back to the drawing board a LITTLE bit on this one – update to come soon.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.