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: Don’t use prefix for default language and trouble with translate_url

Status Resolved
Add-on / Version Publisher 1.1.4
Severity Critical
EE Version 2.7.3

Katrin Kerber

Jan 15, 2014

I don’t want to use a URL prefix for my default language (English) but for all other languages, but I think this is causing issues with {translated_url}.

I am using the following code in my <head>:

{exp:publisher:languages}
    <link rel="alternate" hreflang="{short_name}" href="{translated_url}">
  {/exp:publisher:languages}

When visiting the home page without a URL prefix, all the URLs for each language are the same - see first screenshot.

When going to a sub-page without a URL prefix, the URLs show what they should show on the home page, apart from the ‘en’ one, where I don’t want a prefix at all - see second screenshot.

When looking at a sub-page in one of the secondary languages, the URL for ‘en’ (the site’s default) shows the current URL rather than the correct one - see third screenshot.

How can I fix these issues?

#1

BoldMinded (Brian)

I emailed a new build for you to try. Add this to your main config.php file: $config[‘publisher_hide_prefix_on_default_language’] = ‘y’;

#2

Katrin Kerber

Sorry, I should have mentioned that I had that config setting already in my config file - it is being ignored.

I have added the files you have emailed me, but the problems still persist (and it somehow messed up the display of my Page URIs on my local testing server…).

#3

BoldMinded (Brian)

Someone else is having the same issue and I’m working with him on it. Should have this ironed out tonight or tomorrow.

#4

Katrin Kerber

FYI: The messed up Pages URI are caused by the ‘exp_publisher_site_language_cp’ cookie not being ignored, which was controlled by the ‘Force default language in the Control Panel’ setting. This setting no longer shows in the 115 build you’ve sent me.

#5

Katrin Kerber

OK, let me know if you need anything else from me.

#6

BoldMinded (Brian)

What leads you to believe the pages uri is messed up b/c of that cookie?

#7

Katrin Kerber

‘Messed up’ is probably not the right phrase, it just looked that way to me. It was showing the German ones rather than the English ones. Not all pages are translated, which is why it looked like the German and English ones where jumbled together. I prefer just showing the default language across the CP like it was in 114.

#8

BoldMinded (Brian)

You can go into the exp_publisher_settings table and set that value back to “yes” if you want.

#9

Katrin Kerber

I assume this is something you’ll be fixing, too? If so, I’ll just wait for the next build.

#10

BoldMinded (Brian)

I was hoping to get rid of that setting to be honest, but only 4 or 5 people have this build and 2 have mentioned it being missing already. So I might have to add it back in. In which case you’ll want to update that table manually b/c I’ll remove the code that turns it off in the next release.

#11

Katrin Kerber

I would definitely like that setting to remain. My client will add all the translations, but doesn’t necessarily speak those languages, so if CP showed the links based on the last language used on the Edit screen, then that will cause huge issues.

Why do I need to touch the table? Should I just revert back to 114?

#12

BoldMinded (Brian)

Can you take a screenshot of the links the CP is showing on the edit screen? Just want to make sure I’m understanding correctly.

Reverting to 114 will only change the files, which still use that setting. I just updated the db to hard set it to off and hid the option on the settings page. So keep the 115 files, and update that row in the settings table to return it back to how it worked in 114.

#13

Katrin Kerber

It’s not the Edit screen I am worried about. At the moment, it’s mostly the Pages URI links that will show in various places (like NavEE, Pages module page) in their translated state.

If I revert back to 114, won’t I have the ‘Force default language in the Control Panel’ setting appear again on the Settings page? And then I could set it to ‘Yes’ again that way? I am not too keen on having to touch the table unless I absolutely have to.

#14

BoldMinded (Brian)

You could certainly do that.

I’m just trying to think of how that setting would cause the uri to show the translated value if you’re not viewing the translated entry.

#15

Katrin Kerber

The Edit/Publish screen is fine, it’s the other areas were Pages URIs are listed. It seems that the ‘exp_publisher_site_language_cp’ cookie affects that somehow (but was being ignored when the ‘Force default language in the Control Panel’ setting was to ‘Yes’).

#16

BoldMinded (Brian)

Closing this as we’ve moved to email discussion.

Login to reply