41

No one can be told what the Parse Order is, you have to see it for yourself. Jest aside, parse order is a very tricky subject indeed. My PDF and blog article will help somewhat in grasping it, and some might find my Parse Order Pro sides helpful. But those only are pointers to a more general approach to EE's template parsing. The point is, EE's parse ...


34

For me, one of the most compelling reasons to use a "template partials" approach in EE (or model-view-viewModel - MVVM - if you prefer) is being able to separate out the presentation of your data (e.g. the html markup) from the business and model logic that retrieves and formats the data (the template tags, conditionals, data formatting and so on). This ...


15

Fleshing this out further to answer (in part) your question of what is parse order. Essentially, all parse order is - is the 'order' in which ExpressionEngine takes to process (or parse) each aspect from a page being requested to the completion/render of the page to the browser. The following is taken directly from Low's Parse Order: Read URI to determine ...


13

Here is the basic concept. I personally don't use the list tags to set a ton of individual variables. I find that it's too much and too tedious, and can perform an excess amount of queries if you have a lot of variables. I guess though it really goes down to how you prefer to organize your templates. {exp:channel:entries} {stash:embed:your_context:...


12

Here's a link to Low's foundational pdf -- it's got some more detail which can be useful, and it will am sure update as knowledge grows or EE is extended. http://loweblog.com/downloads/ee-parse-order.pdf Since he will likely not do it, I'll also give a link where Low discusses parse order in detail, and in relation to his very well regarded Low Variables, ...


10

I'd recommend you taking a look at Mark Croxton's if:else and switchee plugins. They allow you to use advanced conditionals (and switches) without the overhead of having all your conditions parsed, which is the default EE behaviour. They're a fantastic way of optimising your site and I'd encourage you to start using them whenever you have a need for ...


9

It seems like putting an if:else inside your simple conditional makes it an advanced conditional, thus affecting parsing order. In other words, suppose segment_1 is empty: {if segment_1 != ""} EE tags placed here won't be parsed {/if} vs. {if segment_1 != ""} EE tags placed here WILL be parsed {if segment_1 != ""} // something here {...


7

The lv_fallback_banner is an Assets variable type, which stores the data like this: {filedir_x}my-image.jpg. To parse the filedir-variable, you need to use the {exp:low_variables:single} tag, so Assets gets called and can process it (instead of just dumping the variable content in the template). In this case, it will always return the parsed variable ...


7

Stash doesn't parse preload_replace. But they will work if you use process="start" with the stash embed, since that effectively includes the sub template code in the host template prior to preload_replace being parsed by EE. However, be aware that if you need to access stash vars captured in the host template then you need to use process="end" (the default) ...


6

Your first conditional statement is an advanced conditional (since it includes an AND clause), which means that both of your {preload_replace} variables are being called every time. Since subsequent {preload_replace} calls for the same variable are ignored, I'd guess that you're ending up with {event_masthead} every time, is that right?


6

So yeah. Parse order. I take it you've seen this pdf. If not, take a look, study it well. What you need is for the opening tag to be in order before you hit stage 5: the parsing of module/plugin tags. In order to do that, you can only use simple conditionals in combination with early parsed global variables and preload replace variables. Native early parsed ...


5

You should do this in an Extension instead - an extension on the sessions_end hook (which is called near the beginning of every request to the site, just after the Session library has finished loading). You could then create new Global Variables before any template parsing begins, and which would then be available to all of your templates. Extensions are ...


5

It turns out that the answer was to add a "random" paramater to the plugin tag, in combination with parse="inward". From EllisLab: "The random is sort of a hidden trick that is handy in very specific circumstances. Without it, duplicate plugins get replaced by some placeholder text so that the plugin is only run once- and then the content flips into where ...


4

I think UltraBob is right in that if you need a global variable available inside the module you need parse them inside the add-on. parse_globals() looks to be the way to do so (thanks to this answer on Stack Overflow). The following will show that the parsed global is available in the module: $parameter = $this->EE->TMPL->fetch_param('...


4

Ok, this is complex so please bear with me. Unlike process="inline" and process="end", the process="start" parameter is relative to the processing stage of the host EE template, not the processing of the nested Stash template (which is undertaken by a separate instance of the template parser and occurs either in parallel with or after the EE parser has run)....


4

You can wrap your code in [code]{ee_tag_here}[/code] and that should output <code>{ee_tag_here}</code> into your template.


4

This is a parse order issue - your Channel Entries tag is being parsed before your custom plugin tag, so you're actually passing misc{exp:cookie:retrieve name="exp_lang"} as the channel parameter. What you need to do is turn your plugin into a tag pair, so it works like this: {exp:cookie:retrieve name="exp_lang" parse="inward"} {exp:channel:entries ...


4

To be on the safe side, I'd check for numerical values only, like 201308. Something like this: {if {event_dates:start_date format="%Y%m"} == {event_dates:end_date format="%Y%m"}} same month {if:else} not same month {/if} When debugging the advanced conditionals, try to remove them and add them one at a time to see which actual one is causing the ...


3

If you're using early parsed vars only, try putting both of them in the same LV group and make sure {lv_tmpl_utility_belt} comes before {lv_ee_casestudy_prevnext_entries}. This ensures that the vars will be put into the template correctly. Having the second var above the first will fail. To clarify, you've got 2 vars, A and B. A contains B, so A needs to be ...


3

I agree that this is a parse order issue. It would probably be better for you to set your global variable in the config.php. Not only will this ensure it's set before the templates are parsed, but it'll also prevent you from needing to use PHP in your template, which makes things a bit more secure and efficient. If you're using the Focus Lab Master Config, ...


3

One reason to use late parsing is that early parsing adds slightly more overhead in a lot of cases. The usual thought is that if you don't need things to be parsed early, you should leave them late-parsed for performance. That said, it's a very minor bit of overhead. It is also possible that you have some Low Variables and you want to use one of them as ...


3

If your url contains the proper category you can use Low's seg2cat plugin to grab the id category="{segment_xx_category_id}" http://gotolow.com/addons/low-seg2cat I'm afk from pc, you may have to tweak parse order but I've used this plugin to great affect many times for this purpose.


3

Welp, after even more testing an hair pulling I sorted it out. I forgot to set parse_tags="yes" on the exp:stash:set... d'oh! Model {!-- SINGLE VARIBLES --} {exp:stash:set parse_tags="yes" trim="yes" } {stash:share_image_url} {exp:ce_img:pair src="{cf_featured_image:url}" width="800" height="450" crop="yes" ...


3

The first thing I would ask is do you really need a fieldgroup for each product channel? Multiple channels can share the same fieldgroup and you can use publish layouts to hide the fields that are not relevant to a particular product. Using the same fieldgroup will also force you to generalise the fields you use which can be a good thing for rationalising ...


3

You didn't say which version of EECMS you're using. Some versions have parsing issues on conditionals with single quotation marks. Or, maybe, your version of Matrix have one of this issues. So, first of all, try to replace them. {if "{placement}" == "sidebar"} {exp:mx_jumper:put name="standard_image_width"}226{/exp:mx_jumper:put} {exp:mx_jumper:put ...


3

Turns out the problem wasn't a parse issue after all. Playa disables categories by default so by placing a blank disable="" parameter on the {cf_feed_videos} tag it overrides this and re-enables categories for the related entries.


3

Stash 2.4.3 corrected a long-standing inconsistency with embeds set to process at the start of template parsing. At the other stages of parsing (inline and end) embeds are parsed by default - that is to say, parse="yes" is the default parameter value if not specified, and 2.4.3 added this as the default for start too. To make your embed behave as it did ...


3

Good news, it should be a quick fix. All you need is to prefix your Playa variables with var_prefix parameter to differentiate the namespace from the Channel Entry variables, although you might have to use the full module tag: {exp:playa:children field="item_colors" var_prefix="pl"} "{pl:title}": "{title}", {/exp:playa:children}


3

put exp:channel:entries inside embeded template {embed="site/channel" my_plugin_ids="{exp:plugin entry_id="{segment_3}"} site/channel {exp:channel:entries channel='{embed:my_plugin_ids}' … -or- put exp:channel:entries inside your plugin tag's {exp:plugin entry_id="{segment_3}" parse="inward"} {exp:channel:entries channel='{my_plugin_ids}' … {/...


3

The quotes around {fn_zone} mean it's an advanced conditional which may be the problem. Can you do: {if fn_zone == ""} ... {/if} Or you may have to use the if:else plugin: {exp:ifelse parse="inward"} {if "{fn_zone}"!=""} {redirect="/store"} {if:else} {exp:stash:destroy name="delivery_day"} {/if} {/exp:ifelse}


Only top voted, non community-wiki answers of a minimum length are eligible