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: Get translated template value
Status | Resolved |
Add-on / Version | Publisher 1.6.2 |
Severity | |
EE Version | 2.9.2 |
Keiron Lowe
Mar 23, 2015Hey I’m trying to get the translated template value but I’m struggling a bit. I want my urls to look like:
* /products/category_1/
* /products/category_2/
* /products/category_3/
I’m using this to generate it:
{path='/products/'}/{exp:publisher:translate_category cat_id="{cat_id}" return="cat_url_title"}/
. It works absolutely fine when viewing it in the default language, but when in another language it removes the ‘products’ part of the url rather than replace it with the translated value, so it becomes fr/category_1, fr/category_2
. Seeing as the path variable is part of EE not publisher, it looks to be an issue with that, so is there any easier way to translated value. Maybe a template tag such as {exp:publisher:translate_template}
?
BoldMinded (Brian)
Keiron, you shouldn’t have to do anything like that for template translations. Just enter the translated value in the Template Translations section, and enter translations for each category’s url title. You can use
Keiron Lowe
That seems to work for translating the category name, but it still removes the ‘products’ part of the URL when viewing in a different language.
In english, it displays properly, so the URL’s are domain.com/products/category_name/, but if I change to French, then they become domain.com/category_name/.
BoldMinded (Brian)
Keiron, I replicated this in my environment and the full path translates:
My full template
Template translations: https://www.dropbox.com/s/aijd4n6wtwldv05/Screenshot 2015-03-24 06.34.36.png?dl=0 Results: https://www.dropbox.com/s/qrtjls24q8yn676/Screenshot 2015-03-24 06.33.54.png?dl=0 https://www.dropbox.com/s/z5iofqgbm35lcts/Screenshot 2015-03-24 06.33.02.png?dl=0
Are you sure you entered translations for the products template group?
Keiron Lowe
Hmm it looks like the it wasn’t using the english fallback for the template translations. So because the template translation for the products template was blank, thats why it wasn’t showing in the url. If I enter a translation for the template then it works.
Keiron Lowe
Thanks for helping me figure out the issue anyway!
BoldMinded (Brian)
No worries 😊