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

HD Force Template (Structure module extension)

Development and Programming

Mark Croxton's avatar
Mark Croxton
319 posts
16 years ago
Mark Croxton's avatar Mark Croxton

This extension allows you to determine the default template for static child pages of specified entries within a Structure page tree. You can already do this for listing type entries on a per-weblog basis, but Structure provides no control for static page template inheritance, beyond defaulting to the parent entry’s template when adding a new page.

It’s pretty rudimentary. In the extension settings rules can be specified in a pseudo json format:

"entry_id" : "template_id"

For example:

"30" : "61",
"29" : "49",
"4" : "14"

So where do you get the entry id and template id? This extension adds the entry id to the tooltip when hovering over an entry in the structure tree, and the template id when hovering over a template name in the template editing panel.

It’s my hope that Travis adds static page template rules to a future version of Structure, but until then this is a crude way to get it done 😊

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

This is a great addition. We’re currently tackling how to handle this as a feature and deciding if it will make it to the next version. Soon after if not, I agree this is important. Thanks for the great work!

       
Mark Croxton's avatar
Mark Croxton
319 posts
16 years ago
Mark Croxton's avatar Mark Croxton

That’s good to know, thank you! And thanks too for creating such a useful module in the first place 😊

       
smartpill's avatar
smartpill
456 posts
16 years ago
smartpill's avatar smartpill

This resolved the only issue I had with your First Child Redirect plugin, where I had to tell the client to manually change the template settings for any page who’s parent was assigned to a redirect template.

Brilliant. Thanks again.

       
Greg Stewart's avatar
Greg Stewart
8 posts
16 years ago
Greg Stewart's avatar Greg Stewart

There seems to be a problem with your extension.

I have a lot of pages in my Structure and on some it cuts of the second digit of the referencing parent entry_id in the “add page” link.

For example:

Edit Link: C=edit&M=edit_entry&weblog_id=2&entry_id=60

Add Page Link: C=publish&M=entry_form&weblog_id=2&parent_id=6&template_id=26

It’s 6 instead of 60, hence it’s not selecting the right parent in the structure dropdown on the edit page.

Greg

       
Mark Croxton's avatar
Mark Croxton
319 posts
16 years ago
Mark Croxton's avatar Mark Croxton

@gstewart

Yes you’ve right it’s a bug. Thanks for reporting it.

Could you please try changing line 156 to:

$pattern = '/parent_id='.$parent_id.'&(.*)"/';

That should sort it (I think) - let me know how you get on.

       

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.