Hot answers tagged

5

This happens because of the "else". If you use else, the conditional became advanced and it will be parsed after the modules. Try this: {if segment_3 != ''} {exp:query sql="SELECT a.cat_id, a.parent_id, b.cat_name FROM exp_categories a, exp_categories b WHERE a.cat_url_title = '{segment_3}' AND b.cat_url_title = '{segment_2}'"} {/if} {if segment_3 ==''} ...


4

What you want is the backspace parameter. "Backspacing removes characters (including spaces and line breaks) from the last iteration of the loop." {categories backspace="2"}{category_name}, {/categories}


4

For deeper understanding, read about Rendering Stages in EE user guide. Advanced conditionals are processed after module tags. Putting it simply, exp:crumbly:breadcrumbs is processed before if statements, so EE engine is receiving 3 exp:crumbly:breadcrumbs opening tags and just one closing tag. There are 2 possible solutions: 1) Have separate code for ...


4

If you're displaying your categories using standard category URLs (e.g., /products/category/central-vacuum or /products/C12), then you only have to add the status parameter to your Channel Entries tag (the category will be filtered dynamically based on the URL). {exp:channel:entries channel="products" status="Featured"} ... {/exp:channel:entries} So in the ...


4

TL;DR: Use AND in your second conditional. Actually, it is working as expected. In the first conditional, you're saying if x is a or x is b, which will return true if x is a or b. The second conditional says if x is not a or x is not b, which will return true if x is a or b, as x cannot be both. Simple logic. I take it you want the second conditional to be ...


4

Try this: <h3> {if long_titles} {long_titles} {if:else} {title} {/if} </h3>


3

You are doing a ton in your template. After a quick look I'd say your slowness is related to your relationship fields. I suggest installing the EE Debug Tool to determine what specifically is "slow" on the page load. That will help you decide how to optimize the template. I also suggest taking a look at CE Cache to see if it makes sense for your project.


3

For a solution for now, how about a different conditional? {if "{url}" != "http://"} <p><strong>Website</strong><br /> <a target="_blank" href="{url}">{company_name}</a></p> <hr /> {/if}


3

You can't separate heading and closing tags by {if} statements like that. I've never used Crumbly specifically, but with ExpressionEngine native tags, BOTH the open and closing tags need to be within the `{if} area to be properly evaluated, so this should work {if segment_1 == "search"} {exp:crumbly:breadcrumbs custom_url:pattern="template_group/...


3

There are no wildcards in EE. You're probably looking for something like Switchee, where you can use regular expression matching, or Mo Variables, which gives you {if paginated}, which could help here.


3

This is what you will need to do. {exp:channel:categories style="linear"} {if "{category_id}" == "70"} <figure> <a href="#"> {if ...


3

Not exactly, but you could put your Channel Entries tag into an embedded template, and use a member group ID conditional to send it the parameters you want based on the visitors membership status. {if logged_in_group_id == 7} {embed="template_group/_template_name" categories="1|2|3|4"} {if:else} {embed="template_group/_template_name" categories="1"} ...


2

This will most likely be to do with parse order. Because you're using advanced conditionals they will be parsed late on and probably evaluated after Matrix conditionals are processed. Give it a try with simple conditionals by just using {if} statements. So: {if dates != ""} do something {/if} {if dates == ""} no dates found {/if} (Depending on what ...


2

add a count to the output maybe? Something like this might help: https://github.com/erikreagan/er.entry_category_count.ee_addon This way you could append a class like 'count_1' etc to each category which is output. Actually this might be more suitable as it's EE2.x compatible: http://devot-ee.com/add-ons/bw-category-count


2

In main-landing.html wrap the stash:set pair around the entries tag pair. {stash:embed:layouts:support-main-landing} {!-- Set data for the landing page --} {exp:stash:set parse_tags="yes"} {exp:channel:entries channel="support" url_title="{segment_3}"} {stash:url_title}{url_title}{/stash:url_title} {stash:title}{title}{/stash:title} ...


2

I saw you already find a solution, but I think you should know the reason your code wasn't working. Your conditional will never work... Ooops! Please, forgive me. Your conditional will always work because "product1" != "product2". This code will always evaluate: {if segment_3!="product1" OR segment_3!="product2"} <img src="/images/styles/madeinusa....


2

You can try MX Calc {exp:mx_calc expression="{current_time} - 600 "} {if entry_date > {calc_result}} .... {/if} {/exp:mx_calc} but still, this is not good solution because whats happens if user will refresh page many times in accepted timeframe? The perfect solution is made small plugin which will do indication that for current entry message was ...


2

You can use stash lists. Store the state separately. On output order by the unique states and use a nested get_list to get the entries/stores per state. (example from Croxton slide: Stash core principles ) {exp:stash:set_list name="my_stores" parse_tags="yes" scope="site"} {exp:store_locator:stores} {stash:item_state}{state}{/stash:item_state} {...


2

There is an add-on from EE Garage that I have used to do that on a store finder before. It's called NSM Channels. http://ee-garage.com/nsm-channels Not sure if there is something similar on Devot-ee.com for free, but I know this works.


2

You just need to vary your syntax slightly: {if '{my_wygwam_field images_only="yes"}'} {my_wygwam_field images_only="yes"} (image code) {/wygwam_field} {/if} This way you're actually telling EE to parse that first tag (inside the conditional statement) - you need to do it this way because it's a tag pair requiring a parameter,so simple ...


2

Have you tried this? The difference is on Line 2. It does mean you're running the conditional against the entire embed string rather than the variable but it may work. {slider} {if "{video}"!=""} {video} {if:else} {if total_rows > "1" && row_count == "1"} <div id='news_slider'> {/if} ...


2

Yikes! With all due respect, this is an extremely inelegant approach. You should never attempt to output different opening tags in this way. Even if you are able to somehow make it work, the next developer to look at this code will be cursing your name! Here are some alternatives: Use the url_titles or the entry_ids directly in segment_3 instead of 1/2/3, ...


2

As someone else has said this is an inelegant approach and there are better ways to do it. But for starters try putting the complete tag pair within each condition and see if that works. i.e. {if segment_3 =="1"} {exp:channel:entries channel ="about" entry_id="33"} stuff {/exp:channel:entries} {if:elseif segment_3=="2"} ...


2

It depends. If you aren't using variables on conditional outside the default order, you can remove ifElse. For example, ifElse parses early variables like member_id and group_id. Take some time to look at the parsing order and see if you need to change it in some way.


2

If I understood what you want, maybe one of these add-ons can help you: Entry Type - A dropdown fieldtype that shows/hides other fields on the publish page; Better Pages - Better Pages is an ExpressionEngine fieldtype designed to make using the Pages module significantly more end-user friendly; Entry Layout - Lets you link custom fields to any entry of your ...


2

If I read your code correctly, you use Matrix field to keep images. Try next code for this: <div class="left article_image"> {if article_images:total_rows>0} <ul data-orbit> {article_images} <li> <img src="{image_matrix_image}" alt=""> <div class="caption"> ...


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'}


2

You cannot close your exp:channel:entries-tag in a branch of the if-structure, because in case you have a banner (first branch) you finish the channel-loop and will not get to the end of the if-construct. Vice versa if you do not have a banner you will not end the channel-loop. Therefore put the closing {/exp:channel:entries} after the very end of your code ...


2

try using channel_short_name == "work" You can find the short name in the list of channels. Also in your channel tag, you'll need to specify both channels. channel="work|latest"


1

Try this: {if '{site_hvite_left}' == '' OR '{site_hvite_right}' == ''} <div class="row-small"> {if:else} <div class="row"> {/if} .. a bit verbose but it should work every time.


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