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

Strange problem with snippets not loading as expected

Development and Programming

rjionline's avatar
rjionline
37 posts
5 years ago
rjionline's avatar rjionline

I am attempting to develop a bunch of revisions to our ExpressionEngine site. It’s an old site running v2.11.6. For reasons, I have set up a hidden template group on the production site, copied over the templates needed, renamed things and so on to get the development area to work without interfering with the production site.

I have a page template in the development group, which is a copy of the template from production. The footer of the page uses a snippet, as the footer is the same on every page of the site.

This page_end snippet includes two snippets and one global variable. The first snippet loads the content that appears in the page’s footer. The second snippet loads JavaScript the site uses. The global variable loads a little bit of code loading a feature on the site, then loads the tags that close out the page’s HTML.

In production, this works fine. In the development template, it works fine as long as I load the production page_end snippet. When I change the template page to load the development page end snippet — which is just an exact copy of the production page_end snippet at this point with the exception of the snippet name — the two snippets that are called from this snippet do not load. It just displays the snippet names in the curly brackets that is in the page_end snippet. However, the global variable it calls loads fine, just as expected.

I have been beating my head up against this all day, and cannot find any clue as to why this is behaving this way. If I call the production page_end snippet, it works fine. If I call the development page_end snippet, even if its contents are exactly the same as the production snippet, the snippets it calls do not load. I have been unable to make it do anything different.

Any suggestions?

       
Brian Litzinger's avatar
Brian Litzinger
693 posts
5 years ago
Brian Litzinger's avatar Brian Litzinger

> This page_end snippet includes two snippets and one global variable

Check the naming of the snippets. Snippets inside of snippets only work (reliably) if they are alphabetical. E.g. if you have a snippet named “a” and a snippet named “b”, but you try to put snippet “b” inside of “a”, it won’t parse correctly because it’s trying to parse snippet “a” first, before snippet “b” has been parsed.

       
rjionline's avatar
rjionline
37 posts
5 years ago
rjionline's avatar rjionline

Thanks for the reply, Brian. Unfortunately, your suggestion doesn’t address my issue. The order of alphabetization hasn’t changed between the production snippet and the development snippet.

I will look it over again and make sure, though.

       
Robin Sowell's avatar
Robin Sowell
13,160 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Out of curiosity, disable extensions. Does it still do it?

       

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.