Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Variable to get Language URL Prefix, if Present?

Status Resolved
Add-on / Version Publisher 1.2.3
Severity Critical
EE Version 2.7.2

Nick Benson

Mar 20, 2014

I’m using Publisher in conjunction with CE Cache’s static file driver. At the moment, I’ve got something like this:

{exp:ce_cache:stat:ic id="page" tags="tag1|tag2" url_prefix="{publisher:current_language_code}"}


That code works perfectly for URLs with language prefixes in them, but is failing to work for my English (the default language, with prefix disabled) entries, as CE Cache is expecting a URL of “/en/foo” instead of “/foo”.

Any chance we could get a tag like {publisher:current_language_url_prefix}, which could solve this? It’d be empty when no language prefix is present, otherwise match the value of {publisher:current_language_code}.

#1

BoldMinded (Brian)

publisher:current_language_code should be set regardless of the prefix setting. lang_code and lang_id are persistent values that are used throughout its codebase.

#2

Nick Benson

Not sure you’re following what I’m getting at - I just need a tag that will give me the language prefix if it’s present in the current URL, and empty otherwise.

On example.com/foo, {publisher:current_language_url_prefix} = ”

On example.com/de/foo, {publisher:current_language_url_prefix} = ‘de’

#3

Nick Benson

The addition of {publisher:current_language_prefix} in the build you emailed me was most excellent, thank you! Mark as closed at your leisure.

Login to reply