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

Slack: Can I prevent an template from including the site layout specified?

How Do I?

From EE Slack's avatar
From EE Slack
185 posts
9 months ago
From EE Slack's avatar From EE Slack

Is it possible to exclude a template from using a layout template? Im looking to fetch some html from a hidden template and insert it into my page with JavaScript . The hidden template is including the site layout and I’d like to prevent that. Is this possible?

Interested in learning more solutions or want to get to know other EE users? Read more about joining the slack here! Join Our Slack!

       
From EE Slack's avatar
From EE Slack
185 posts
9 months ago
From EE Slack's avatar From EE Slack

No. The template layout process happens on the server before the HTML is sent to the browser, and so before the browser has any opportunity to run javascript.

It is possible for you to insert some hidden HTML into your page using javascript (or simply to build the page with the HTML hidden if that’s easier), so what you want to do can be done - just not by using the template layout system.

If the code is used in more then one place, you could put it in an embed, and include it in the template that has the layout and needs it, as well as the other template (without the layout)

Going to shift to embeds. Thx all!

       

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.