10

Use Mo' Variables. It will give you access to GET variables like this {get:your_key} (in your case {get:score}). Mo' Variables has many other uses, as well!


4

Using the matches operator, which was added in EE v2.9.0: {if segment_2 ~ "/^\d+$/"} [...] {/if}


3

The easier and faster way to do this is using Preload Text Replacements and snippets. Snippets are parsed before Preload Text Replacements. So you can put them inside snippets. Let me show you an example. This is part of a snippet called doctype-and-styles-snip: {preload_replace:pre-rootclass=""}<!doctype html> <html class="no-js no-jquery {if ...


3

Use Stash - Here's how: {!-- ============================================ STORE A LIST OF RELATED ARTICLES INTO A LIST ================================================== --} {!-- first the manually chosen ones --} {exp:stash:set_list name="rels" parse_tags="yes" trim="yes"} {exp:channel:entries channel="article"} {related_articles} ...


2

You'll need an embed, with or without stash. I always prefer to not use add-ons if I can. So, without stash: {exp:channel:entries status="featured" limit="1"} <div class="featured"> [...] </div> {embed="entries/.list" featured_id="{entry_id}"} {if no_results} {embed="entries/.list" featured_id="0"} {/if} {/exp:...


2

I see that you have php preg_match but no opening/closing php tags. Are those elsewhere in the code? If not then add opening/closing php tags and see what happens.


2

A good starting point for an error like this is to reduce your code... remove your conditional line by line until you find the offending line. Also, try this patch posted to a similar EE bug: https://support.ellislab.com/bugs/detail/17989


2

Embeds are normally parsed at the end. You can try setting a variable with Stash. In the main-template get the variable at process-end. A better approach is to use stash to store your data in the first place, and avoid an extra embed altogether. https://github.com/croxton/Stash // template1 ----------------------------------------- {exp:stash:set name="...


2

exp:stash:get_list is a variable pair. So, try exp:stash:list_count: {exp:switchee variable="{exp:stash:get name='custom_sidebar_text'}/{exp:stash:list_count name='related_articles'}/{exp:stash:list_count name='related_events'}" parse="inward"} {case value="/0/0"}{/case} {!-- Ignore no value --} {case default="Yes"} <aside class="{exp:stash:...


2

If your trying to pass a simple value to your layout, you can set it on the layout tag. For example: {layout="pages/.layout" body_class="contact"} But custom fields variables need to be parsed by the channel:entries variable pair. This is the reason for the tag layout:set. {exp:channel:entries [...]} {layout:set name="desc"}{timeline_item_description}{...


2

Unfortunately, for now, version 2.9, there isn't. But I suggest you to ask EllisLab for it. I guess isn't that hard to implement, but they are possibly busy because of the EECI Conf. This and an output parameter can be really useful.


2

You should try separating the data-fetching from the markup-assembly - this way you'll be able to cleanly fetch all your member variables and store them into Stash vars for use later (either in the same template or an embedded one). Here's a tutorial I wrote describing how to do this: http://www.jamessmith.co.uk/articles/expressionengine-stash-tutorial-level-...


2

First of all, the stylesheet tag needs quotation marks. {stylesheet="global_embeds/style"} If you link to the JS file using path variable, all the templates variables on the linked file will be parsed. {path="global_embeds/init.js"} But I really don't think it's good for performance. It's much better to use static links for the JS and CSS.


2

I've found a way to do this; not sure its the 'right' way, but it works and seems logical :-) {exp:plugin_name parse="inward" variable_to_pass="{some_id}"} Then in the plugin: $my_var = $this->EE->TMPL->fetch_param('some_id');


2

From my own testing, the value set for the {layout:title} variable will cascade back through the layout templates to the outermost layout. So if you set it in a nested template or a template that ultimately uses the global layout, then the value of the variable will be available to the global layout. If you set the {layout:title} variable in a nested ...


2

There are some issues in EE 2.9 with conditionals on prefixed variables and variable modifiers which I don't totally grok. (See bug report here for some discussion.) But the moral is, try this: {if '{promotions:tour_show_specials_banner}' == 'y'}


1

It is in general not a great idea to use PHP straight in the template, but that's a story for another day. It would be best to use Expresso Store's developer hooks like the "store_order_complete_end" hook to create and process the XML file on success. Going with your example: Check the string you are building up in particular at the tag. ".$instruction."{...


1

I don't know if this will be helpful to anyone else, but I solved my problem. Basically, I went back to thinking of this as something best handled by relationships rather than categories. I realized that if I use Playa instead of EE's native relationships my client could just check off all of the classes that an event is related to. That makes listing ...


1

The best coding practice is to utilize view files in order to achieve that.


1

Here was the final solution. {exp:playa:children field="3rd_order_under" sort="asc" var_prefix="thirdorder"} <li {if '{thirdorder:count}' == '1'}class="active"{/if} id="pillTab{thirdorder:url_title}Tab"> <div class="row"> <div class="twelve columns"> {thirdorder:...


1

The inner exp:playa:children tag should not be prefixed. The var_prefix is for the variables inside the tag, not for other tags. You'll want to do something like this: {exp:playa:children field="3rd_order_under" sort="asc" var_prefix="thirdorder" } 3rd count: {thirdorder:count} of {thirdorder:total_results}<br> 3rd url_title: {...


1

To try and get a handle on what's going on, I would break things down to just the variable output and forget about the html markup until it makes sense. Try this and see if you can pinpoint it: {exp:playa:children field="3rd_order_under" sort="asc" var_prefix="thirdorder" } 3rd count: {thirdorder:count} of {thirdorder:total_results}<br&...


1

The array that you're passing to parse_variables is incorrectly structured - it needs to be one level deeper. You can fix this either by wrapping it in an array: return $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, array($data)); Or using parse_variables_row instead: return $this->EE->TMPL->parse_variables_row($...


1

Install Mo'Variables http://devot-ee.com/add-ons/mo-variables then you could use: "Early-parsed Member Variables (for use as tag paramters): {logged_in_member_id}, {logged_in_group_id}, {logged_in_username}, {logged_in_screen_name}, {logged_in_email}" Hope it helps


1

You're basically just looking for a way to filter down channel entries based on a filled out form. Take a look at either Solspace's Super Search or my own Low Search. Both should be up for the job.


1

Try the Wires addon. Mark, who created switchee and ifelse, is yet writing the docs and improving the code, but, by my tests, it's stable.


1

This doesn't works because this conditional isn't a simple one, so the template parser tries to parse the exp:calendar:cal before the conditional. Simple conditionals looks like this: {if foo == "bar"} They are parsed before at the stage 13 on Rendering stages. Everything else are advanced conditionals, parsed at stage 18. So, {if {current_time format="%...


1

Try adding parse_depth="x" to the Stash embed, where 'x' is a number greater than 4 (which is the default). EDIT: You are effectively using the embed like a snippet, so I would suggest including the embed before tag processing begins, without parsing it so that you can still pass it variables during: {stash:embed name="my_total{count}" file_name="_stash:...


1

I did the math within the SQL to receive my results. EDIT: The solution. SELECT COUNT(entry_id) / 25 AS count FROM exp_channel_data WHERE channel_id = 97


1

$this->return_data = $this->getMyString(); return_data should only be used for the construct method (nod to Derek ;). In the EE template: {exp:test}woo hoo{/exp:test} or {exp:test:getMyString}woo hoo{/exp:test:getMyString} I appreciate this is only a test, but you can't return anything from the construct if you're returning stuff from the methods ...


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