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: {publisher:segment_1} not translated and problem with route feature
Status | Resolved |
Add-on / Version | Publisher 1.6.3 |
Severity | |
EE Version | EE v2.10.1 - Build Date: 20150501 |
Barbara Cinotti
May 14, 2015Hi Brian,
I’ve tried to use the templates translations and the routes features.
Detailed steps to reproduce the issue:
1. I have 1 channel: news-events in a site with 2 languages (italian default language and english)
2. I have a Template Group: news-eventi
3. Inside the “news-eventi” template group I have 2 Templates file: index for listing entries and view for the detail page.
4. I set up the Template Translations in Publisher Settings in this way: Template -> news-eventi——-> English: news-events
5. Switching from language to another works fine… For the listing enties (index) I have /it/news-eventi and /en/news-events
6. To link to my detail page I’m using:
<a href="{title_permalink='{segment_1}/view'}">{phrase:text_more}</a>
and it’s works
7. If I use
<a href="{title_permalink='{publisher:segment_1}/view'}">{phrase:text_more}</a>
it doesn’t work ...doesn’t give me the translated segment. Is this correct? Should {publisher:segment_1} give me the translated segment?
8. Try to use the route feature to remove the “view” from the url.
9. Setting in Template Route Manager:—> news-eventi—> view—> /news-eventi/{news:alpha_dash}
10. Setting in Publisher Route setting:—> news-eventi—> view—> /news-events/{news:alpha_dash}
11. If I use
<a href="{route='{segment_1}/view' news='{url_title}'}">{phrase:text_more}</a>
it renders in different ways:
in italian (default lang) is correct gives me the right url to the news (without view segment): news-eventi/im-a-test-news
in english it renders in a weird way:
<a href="{route='news-events/view' news='im-a-test-news'}">more</a>
my code
{exp:channel:entries channel="news-events" dynamic="no" publisher_enable_persistence="no" }
<h1>{title}</h1>
<p> {body}<br /></p><p><a href="{title_permalink='{segment_1}/view'}">{phrase:text_more}</a></p>
<p> {/exp:channel:entries}
Maybe I miss something….
Any help is appreciated
thanks
Barbara
BoldMinded (Brian)
{publisher:segment_1} provides the original, untranslated segments. If you want translated you just use the normal {segment_1} variable.
Barbara Cinotti
Thanks Brian,
so for the route to remove the view template name, i have
that in italian default language render in the correct way
but in english is wrong
It seems that in english it doesn’t parse it.
Thanks
Barbara
BoldMinded (Brian)
What happens if you just hard-code the route tag? {route=’news-events/view’ news=’im-a-news’} instead of using {segment_1} in it?
Barbara Cinotti
I’ve hard coded either the segment_1 either the url_title
in italian is correct, im english still remains wrong
BoldMinded (Brian)
So its just flat out not parsing the {route=”“} tag and rendering the unparsed tag to HTML in the non-default language.
BoldMinded (Brian)
I’ll be able to dig into this more this weekend or early next week. Won’t have a solution today, sorry.
Barbara Cinotti
Don’t worry Brian!
Take your time 😊
I’m still in development and I’m sending you all the “weird” things I found.
I’m using also a clean installation with only Publisher so I can exclude that other plugin can interfer be the culprit.
Have a nice week end
Barbara
BoldMinded (Brian)
Comment has been marked private.
Barbara Cinotti
Comment has been marked private.
BoldMinded (Brian)
Are you sure the hard-coded second route is correct? E.g. it is set to a valid group/template? I did some testing locally and before I even started working on the translation part I had issues getting the routes to work, then I realized I had spelled my template group name wrong.
Barbara Cinotti
Hi Brian, I think that the second route is correct, but probably there is something that I’m missing….
Description of my steps:
1) clean local installation with EE v2.10.1 - Build Date: 20150501 and Publisher 1.6.4 only - Publisher settings default except Enable URL translations? Yes - Add URL prefix? YES - Add URL prefix to the homepage? YES 2) setup 2 langs: EN (default) and IT. 3) create a template group –> events 4) inside events, create 2 template –> index (for entries listing) and view (for detail page) 5) create a channel –> events (just a title and a body field). 6) go to translate the template group (publisher - template translations) and beside events setting –> eventi (for italian translation) 7) my code for listing entries in index template inside events templates group that works fine (either in english than switching in italian)
one of the link is rendering :
8) now I want to remove the “view” template from the link. 9) go to EE template route manager and in group events - template view put –> /events/{news:alpha_dash} and setting required segment Yes 10) go to publisher - template translation and put –> /eventi/{news:alpha_dash} 11) change the url in the index template as follow
and the links are render as follow:
I’ve tried also hard coded the route and tried with different quotes (single, double) but the result is the same.
Thanks
Barbara
BoldMinded (Brian)
I removed the Route column from the Template Translations settings page, I think I found a better way to do this without needing all that extra config. Its assuming, and I think this is the normal scenario, that all {route=”“} variables will be put in templates with the default group/template names, in which case I don’t think all the original route handling I created isn’t needed anymore. So, I’ve disabled the result of what those form fields do to see if the new build works as intended. Let me know how it goes.
BoldMinded (Brian)
Comment has been marked private.
BoldMinded (Brian)
Comment has been marked private.
Barbara Cinotti
Comment has been marked private.
BoldMinded (Brian)
Barbara, here is what I’m using to test:
And the output:
The url_title tag does not parse, even when Publisher is disabled. I’m guessing the route tag doesn’t natively have the context it needs to parse the url_title parameter value.
BoldMinded (Brian)
Comment has been marked private.
Barbara Cinotti
Comment has been marked private.
BoldMinded (Brian)
Comment has been marked private.
Barbara Cinotti
Comment has been marked private.
BoldMinded (Brian)
Comment has been marked private.
Barbara Cinotti
Comment has been marked private.
BoldMinded (Brian)
Barbara, try un-installing and re-installing that extension.
I’m going to close this ticket as the main issue is resolved. I don’t want 2 separate issues in the same ticket. If the NavEE error is still an issue after un-installing and re-installing, then create a new ticket. Thanks.