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: exp:publisher:languages has a trailing slash only for language “en”, and not for other langs

Status Resolved
Add-on / Version Publisher 2.6.4
Severity
EE Version 3.5.11

Werner Gusset

Sep 27, 2017

Description:
This Tag

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

creates on a site with 3 languages a source code like this

<link rel="alternate" hreflang="en" href="https://www.amotech.ch/en/showroom/mobility-lab/">
<link rel="alternate" hreflang="de" href="https://www.amotech.ch/de/showroom/oev-lab-am-rheinfall">
<link rel="alternate" hreflang="fr" href="https://www.amotech.ch/fr/showroom/emplacement-attrayant-neuhausen">

Laguages “de” and “fr” don’t have the trailing slash, which is wrong.

I let check a fellow of mine on an other website with two languages (and same software combination) and he also has a slash for the language “en” and not for the other language “de”.

My project has “en” as default language and my fellow has “de” as default. So the default language seems not to be important. Looks as if “en” always gets that slash at the end and additional languages do not.

 

 

 

#1

BoldMinded (Brian)

Thanks for the report, Werner. If anything the de and fr links are correct and en is wrong. It should not have a trailing slash. EE’s native behavior is to not add trailing slashes to URLs. I’ll take a look at this in the next couple of days.

#2

BoldMinded (Brian)

Werner, I’m unable to replicate this, locally or on the demo site. Look at the top of the Debug section at the bottom of the page. I’m using the template code you posted. http://demo.boldminded.com/en/shards/bant

#3

Werner Gusset

Sorry, I can not see an output of ” <link rel=”alternate” hreflang=”de”……” with a translated_url.

PS: I re-checked with Res (my follow programmer) and have to correct my first post: the trailing slash IS at the end of a translated_url for the default lang.

#4

BoldMinded (Brian)

I didn’t put the full html in there b/c you’d have to view the source to see it. Its right below the Debug heading:

https://www.dropbox.com/s/4i1lg63krrkelrn/Screenshot 2017-09-27 09.04.06.png?dl=0

#5

Werner Gusset

OK, got it.

But that’s strange. You can see here view-source:https://www.amotech.ch/de/showroom/oev-lab-am-rheinfall on line 52

What do I need to do?

#6

BoldMinded (Brian)

Is that page using a template.group/template.html based url, or is it a Pages/Structure url?

#7

Werner Gusset

No structure. It’s html.

There are many pages that put the translated_url right (without trailing slash). See https://www.amotech.ch in the footer where I put the url’s.

But the page in question https://www.amotech.ch/de/showroom/oev-lab-am-rheinfall adds a slash for Englisch. I checked the url_title in the entry, which is without slash.

#8

BoldMinded (Brian)

Werner, have you logged into demo.boldminded.com to try to replicate the issue?

#9

Werner Gusset

No, I have not. BTW I would not be able to modify templates when I logged in.

But I can not see what I should replicate in your demo.

On my site more than 95% URL’s get translated correct (without trailing slash). So do URLS translated more than 95% on Res’s site.

But we both have two or 3 URL’s that get a slash at the end when translated.

Have you checked www.amotech.ch where we have the translated_url’s visible in the footer?

If you are here https://www.amotech.ch/de/ueber-uns/bereich/impressum : German Lang and menu item “Über AMoTech/Impressum” all links are OK (without trailing slash).

Now click for language “En” on top : German URL get a slash.

Now click on language “Fr” : All links OK, German has no slash.

Now click on language “De” : All links OK.

Now click on language “En” : German gets a slash.

There is menu item “Über AMotech/Über uns” with the same behaviour. While all other submenus of “Über AMotech” do right”.

When you look at “Showroom” that shows 2 submenu items (entries) you’ll see the second do right, but the first always ads a slash on language for the “en” translated link.

How do you want me to replicate all this on your demo?

#10

BoldMinded (Brian)

The demo site’s admin user has access to add and edit templates, as well as entries and channels. I just logged in as the admin user to verify. You should be able to replicate it there.

#11

Werner Gusset

I understand.

See, we have 2 different multi language websites here. Both have among their dozens of pages 1 to 3 pages where there is this described trailing slash. We analyzed in detail to find out if situation or code might have something in common. It just happens at random.

I understand how difficult it is to debug software when there are random errors and one can not replicate them. I am not able to rebuild one of those website in your demo, just because we have not the time for this work that would take hours. I have to accept, that some of the pages will get reported from Google in our Webmaster tools. We appreciate your efforts. You can close this if you want.

#12

BoldMinded (Brian)

Werner, I can try to look into this more but I’ll need CP and FTP access to the site so I can try to debug it. It’ll probably be a week or two before I can do this b/c next week is the EE conference so I won’t have much time to look into this. You can edit this ticket and add the CP and FTP info in the fields provided.

#13

BoldMinded (Brian)

At this point in time though since I’m unable to replicate it, and no other customer is reporting a similar issue, and this seems to be happening on random urls and not all, I’m leaning towards this being an environment specific issue. Something in your environment could be triggering Publisher to add the slash, or it may not be Publisher related at all… I just don’t know. I’m happy to look into it if you provide the CP and FTP info, and if its a legitimate bug with Publisher then I would like to fix it.

#14

Werner Gusset

Brian, I will send you the login details these days. Take your time for the conference.

#15

Werner Gusset

Comment has been marked private.

#16

BoldMinded (Brian)

Should be fixed now. Try editing it again.

#17

Werner Gusset

Sent the details for login.

Look at these links for the trailing slash https://www.amotech.ch/de/showroom/oev-lab-am-rheinfall https://www.amotech.ch/en/about/category/about-us

#18

BoldMinded (Brian)

Can you point out the link(s) that have the trailing slash on those pages?

#19

BoldMinded (Brian)

Nevermind, forgot you mentioned them earlier. I see them now.

#20

BoldMinded (Brian)

Werner, I think I found the bug and fixed it on your production site. I’ll post a new build shortly if you need the file changes for other servers.

#21

BoldMinded (Brian)

Comment has been marked private.

#22

Werner Gusset

Thank you Brian

Seems to be OK now. Will use the new build for the second site.

Login to reply