7

I believe EE actually throws this value away, and it should. The hash is a front end display feature for your browser, not a url. Use it for javascript and scroll-to positions on a page. You should re-think why you need to be using the hash in the first place.


7

Install the Streeng plugin. Perform common operations on strings. Change case, truncate, find/replace, repeat, encode/decode, generate slugs and more. One of the parameter options is capitalize="yes" which lets you capitalize the first character of the string.


6

CE String is another great option. CE String is a string manipulation tool for use in your ExpressionEngine templates. It is feature-packed, and allows you to manipulate strings (text) with very simple syntax. You would just do: {exp:ce_str:ing strtoupper}{segment_2}{/exp:ce_str:ing} CE String has tons of other useful methods. And the chaining feature ...


4

While you could easily use Stash to pass the entry ids as a variable, you shouldn't. To create the variable would mean iterating over the entire list of entries in a channel. That's expensive just for a simple routing operation. Assuming this is being run on your site's default index template, and you have strict 404s disabled, why not just redirect if ...


4

Well here is the issue. You are trying to give OR condition for 2 strings. OR condition will return true if any one of the given statements are true. If you want to execute the code when url_title not equal to "portfolio" neither equal to "photos" use this condition: {if segment_2 != "portfolio" && segment_2 != "photos"} <p>Conditional ...


3

ExpressionEngine 2.8's introduced Template Routes so you now have more control over how your templates are processed. It allows you to override the default template route, which is /template_group/template. For example instead of going /blog/read/url_title you can now add a template route for read.html in the blog template group to load like /blog/url_title ...


3

Try adding this within your channel:entries tag: {exp:channel:entries ....} {if no_results}{redirect="404"}{/if} {/exp:channel:entries} This should trigger a 404 error on paginated pages that have no entries in them. If you install Mo' Variables, you can enable an {if paginated} conditional for your templates. Then you can get a bit more specific and ...


3

ExpressionEngine have a variable {last_segment} to get the last segment of URL. You can use any Math plugin like "Simple Math" (http://devot-ee.com/add-ons/simple-math) and divide that last segment by 100. {exp:simple_math calculate="{last_segment} / 100"} Also, try by using PHPStringFun (http://engaging.net/products/phpstringfun) to format the number.


3

In your case, you were comparing 2 variables (string) without quotes so both variables will be considered as TRUE i.e {if TRUE == TRUE} #### {/if}. In the same way when you put a single variable tag in if condition like {if variable_name} #### {/if} OR {if {variable_name}} #### {/if} Having the quotes (single or double), EE considers the variable/s tag ...


3

Check the date on the entry. Perhaps it has accidentally been set to the future at some point and so only just started working now. Just a thought.


3

Theoretically it is possible. IF you are on EE 2.9+ you can use Mathematical Operators in your conditionals. (Thanks Derek for reminding me about that!) If you are using a version below EE2.9 you would need to use something like MX Calc to calculate the totals and then use that to call an embed to get around parse order issues. Having said that is probably ...


3

You should try your code in below manner. {if ! 'portfolio|photos' *= segment_2} <h1>Conditional content.</h1> {/if} You can also try in another way also. {if segment_2 == 'portfolio' OR segment_2 == 'photos'} {if:else} <h1>Conditional content.</h1> {/if}


3

I would use this to check multiple pages: {if "page1|page2" *= segment_2} active {/if}


2

You should look into "URI Class"


2

RewriteRule ^(.*)$ /index.php?/$1 Instead of... RewriteRule ^(.*)$ /index.php/$1 Normally the first thing I try when query strings go wrong!


2

Is the both occurrences of {exp:stash:get name="segment-3"} on the same template? In this case, I know how to fix this. This is a trick peculiarity of eecms template parser that sometimes bites us. The template parser, when fount some tag to parse, looks for all another instances of the same tag, with the same parameters and the same content on the ...


2

The no_results conditional should work, something like: {exp:channel:entries channel="speed_sales" dynamic="no" url_title="{embed:url_title}"} {if no_results} <!-- Content for no results --> {if:else} <!-- Otherwise ... --> <h2>{title}</h2> {if lead_copy}<p class="lead">{...


2

The only thing i see from a security standpoint is EllisLab considers php in template a bad practice. If this where me I would create a small plugin that would render your PHP for you. and pass the segment through a parameter. That would then redirect the user. To create a plugin you can use my plugin starterkit. 1.) Create a folder with lowercase plugin ...


2

I actually solved it by using the javascript window.location.hash.substr(2); Thanks.


2

For the first URL, you won't get a valid category ID, as {last_segment_category_id} points to the last segment: the date. You'd need to get creative with simple conditionals and preload replace vars. Something like this: {if segment_4 != ''} {preload_replace:pre_category="{segment_3_category_id}"} {/if} {preload_replace:pre_category="{...


2

Have you considered the reverse? e.g. start at the brand channel and get the parents (e.g. products)? Might be more easy. Grid is quite new and the relationship field also was recently changed (2.6) search and categories are not mature i guess (Relationship field tag parameters). Have you also tried Grid search:column_name=? edit as noted in the comments ...


2

solved: {if url_title == "{last_segment}"} class="active"{/if}


2

As long as you don't have a template or template group named that url title, you can code your index template to take in {segment_1} as a url_title. {exp:channel:entries channel="foo" {if segment_1}url_title="{segment_1}" dynamic="no"{/if}} edit: This only works if you set strict url's to no


2

Turns out this was due to Transcribe, we needed to use {exp:transcribe:uri path="/"} paths!


2

As far as I know this flatly can't be done without hacking the core and even then it's possible that third-party functionality (and even base functionality) might break. Maybe explain your issue a little more -- there might be a way to accomplish your goal WITHOUT the need for extra segments? Edited to add: You can TRY the following, it should work for ...


2

You need to start your URLs with a forward slash so: work/category/web/ becomes /work/category/web/


2

You can do this using Resource Router instead of the Pages module. In your system/expressionengine/config/config.php file: $config['resource_router'] = array( ':any/:any/(info|menu|hours|some_other_page)' => function($router, $wildcard1, $wildcard2, $wildcard3) { $validCity = $wildcard1->isValidUrlTitle(array('channel' => 'cities')); ...


2

It should work fine. You're just missing a dynamic="no" on your channel:entries tag. Try it like this: {exp:channel:entries channel="my channel" category="{segment_3}" disable="category_fields|member_data|pagination" dynamic="no" }


2

Found a solution using Low Seg2Cat plugin to get category_id from segment url: {if segment_4_category_id == category_id}active{/if}


2

The conditional operators that work in EE are listed in the documentation. The two conditional forms you talk about are not equivalent, they just happen to give the same outputs for the inputs you describe. The first form (with the && in it) only fires if the url_title is not portfolio and also not photos. So if you tested the url_title hot with ...


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