1

I have a bilingual website using locale.

I have a content type that has the "link" field.

I have an Image Slider created with Views with the link as one of the fields.

The url in the link field is "services". In English, this works fine and goes to

www.domain.com/services

While viewing the view in Spanish, it adds "/es" to the URL twice

www.domain.com/es/es/services

Instead of:

www.domain.com/es/services

Is this an issue with pathauto? Views? Link?

2

In case anyone is having a similar issue, this is how I fixed it.

There may be a better way to do this but I can at least say that this worked for me.

Situation:

So let's say that there is a view that contains two fields. "Path" (for the path to the node being listed) and the "Name" (Arbitrary text field).

The value of the "Path" field contains something along the lines of "/services" (English) or "/es/services" (Spanish). I exclude it so I can link the outputted title as a link to that path.

My Initial Situation:

I INITIALLY did what seemed logically correct (and what usually works). I chose to "Output this field as a link" and chose the "Path" token (under "Re-write results").

enter image description here

For some reason, using this was outputting the path incorrectly,

Solution:

Interestingly, doing the following fixed it:

enter image description here

Rather than selecting "Output this field as a link" and specifying the value of the "Path" field as the "Link path", I re-wrote the results entirely by coding it by hand.

It baffles me since to me, it appears that doing both of these methods should produce the same results.

Regardless, if you have the same issue I had, this will definitely work.

PS: Modules I have enabled that may have contributed to this:

  • Views
  • Pathauto
  • Locale (for multiple languages)
  • Links
| improve this answer | |
1

Your link URL has to be "/services" or "services" depending on what you are trying to do, test both. URL path must NOT be "site.com/services."

| improve this answer | |
  • I tried both of those but none worked for some reason. Thank you for the suggestion, though. I solved it with a different method (posted in an answer to my own question) – AndrewMRiv Mar 30 '16 at 21:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.