People who code: we want your input. Take the Survey
4

This looks like a bug on the no_results conditional, to me. May I suggest you something? Let's change your approach to this. Look at the docs. You should take advantage of the parsing order and do not let your code run if you can avoid. So, use simple conditionals around the channel:entries variable pair. This way, in the two first situations, the parsing ...


3

Maybe there's a better native ee way without enabling php, but I would use Stash or Low Search. Use Stash (set_list) to set a list of all your search results and then you could have more control over outputting for each tab/channel (using get_list). When you set your list set a variable for channel (i.e.: "my_cached_channel_var"), and then when you output ...


3

Yes, of course! return $this->return_data = ee()->TMPL->no_results(); Or this, on the versions before 2.6: return $this->return_data = $this->EE->TMPL->no_results();


3

WOW!!! I feel a little embarrassed on this one. I will still post the answer since I have seen several other posts in various sites, be it EllisLab support, here, or others. Another fine example of forgetting something very simple and why reviewing the docs on a regular basis is a great idea. ;) Adding the following allowed the search of the entry inside ...


3

Update Since the VMG Chosen Member is a custom field that just captures the member_id and doesn't override the author_id of the entry, you could use the search parameter with Low search to find the correct entries: {exp:low_search:form collection="fsr" search_mode="all" search:fsr-customer="{logged_in_member_id}" result_page="search/...


2

Expression Engine will be trying to determine the parameters for your channel entries tag dynamically from the url so you need to turn this off. You can do that with the dynamic="no" parameter. You probably should just get one entry to save on overhead using limit="1". This will also simplify your code as you won't need to use the count conditional. Adding ...


2

I found if I repeat the no_results line, the redirect works. If I just write it once, no redirect occurs, though the content also does not show up, which is good. Does anyone have an explanation for this behavior? Navigating to a URL I should not have access to as a logged in user redirects me to /site/1 using this: {lv_permissions} {exp:stash:parse ...


2

The short answer is to use a full template_group/template path to your 404, e.g. {redirect="site/404"} I explained the reason why here: Strange Stash & redirect issue EDIT: Since this post was made I have added a new tag {exp:stash:not_found} to help with situations where the no_results condiotonals are nested inside other tags: https://github.com/...


2

I'm not sure if this works with the {exp:stash:cache} tag or not, but you can try it: {exp:stash:cache name="page" unprefix="my_prefix"} {exp:channel:entries channel="post" disable="categories|category_fields|member_data|pagination|trackbacks" require="yes" } {if my_prefix:no_results}{redirect="404"}{/if} {/exp:...


2

Removing the custom profile data tag around my channel entries tag resolved the issue.


2

Robson's suggestion is on the money. Another approach would be to use the awesome IfElse add-on so parsing is less of an issue. Using your example, it would look something like this: {exp:ifelse parse="inward"} {if segment_4 != "" || segment_2 != "staff-bio"} {redirect="404"} {if:elseif segment_2 == "staff_bio"} {if segment_4 == ...


1

I would think just putting those pages into a robots.txt file would be effective. Just a plain text file that sits in your website's root directory and includes basic site information (e.g. about location of your sitemap etc.). This can include statements instructing Google's robots to ignore specific files and folders - e.g. Disallow: /ajax/ will tell ...


1

Late to the party here but my guess is because you have dynamic="no" so it will always return a result.


1

The if no_results is actually referencing the outer exp:channel:entries tag - basically an EE parse order issue. To test inside playa, you need to use the var_prefix parameter... as in: {exp:playa:parents var_prefix="my_var"} {if my_var:no_results} //no results behaviour here {/if} {if my_var:count == '1'} <h4 class="f400m"><strong>{...


1

Maybe a little bit of javascript/jquery to do it on the client-side :-) (1) jQuery Move / direct the stuff into the correct tab. First set a default <li> for each tab with a not-found message, this can be replaced or removed after the result is set. // all items {chan:entries} <li class="item {channel_short_name}">text</li> // jQuery $("#...


1

My No Results Page had this code, which is incorrect: {exp:search:search_results} <p>We have been unable to find any results for '{exp:search:keywords}'</p> {/exp:search:search_results} I found the answer I was looking for here: http://ellislab.com/forums/viewthread/242817/ By using this code: Sorry, there are no results for '{exp:...


1

If you use some custom text field to keep timestamp, in this case I think you need activate php and set it to be parsed on "input": <?php $beginOfDay = strtotime("midnight", ee()->localize->now); $endOfDay = strtotime("tomorrow", $beginOfDay) - 1; ?> {exp:channel:entries channel="LIVE_STREAM" search:timestamp_field="<&...


1

Try {if rating_no_results} ... {/if}, which is the "no results" conditional used in the other Rating tags. Looks like the "comment" part should be removed in the docs.


1

Well, it is issue related to switchee (thanks Robson Sobral for pointing me to that). The {if no_results} behaviour is ‘owned’ by the outer wrapping tag not the inner tag. This is an EE bug/feature and not unique to Switchee. Because of this, Switchee has it’s own no_results handling which will work for each nested switchee layer: {if switchee_no_results} ...


1

Since this question has been answered above, but hasn't yet been added as answer, I'll answer it here, so it can be marked as answered and corrected. I ran into the same issue but solved it a little bit differently. Where the answer above redirects in the template, I did the redirection immediately in the template, rather than the embedded snippet. Like ...


1

I use: {if my_assets_field} {my_assets_field limit="30" offset="80"} <li><a href="{url}" alt="{alt_text}">{filename}</a></li> {/my_assets_field} {if:else} the end {/if} But I don't know if this solution works for what you need with your ajax call.


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