Keyword

Absolute links are turned into relative links

  • den_dhaeze
  • den_dhaeze's Avatar Topic Author
  • Offline
  • New Member
More
8 years 9 months ago #145404 by den_dhaeze
Hi,

wafelfrietjes.mascomm.be/verkooppunten-professionnals/item/49-mister-pop

On this page I added a website url in the K2 extra fields. I entered www.misterpop.nl but when I click on it goes to www.wafelfrietjes.be/www.misterpop.nl .
How can I fix this? This doesn't happen when I add http:// in front of the url but I don't want to fix it everytime our customer enters a links without the "http://".

Thanks,

Michiel

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 9 months ago #145412 by Krikor Boghossian
Replied by Krikor Boghossian on topic Absolute links are turned into relative links
Hello,

This is how links work in HTML.
Links without http:// are treated as relative links.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
8 years 4 months ago #149826 by Kogos Grain
Replied by Kogos Grain on topic Absolute links are turned into relative links
any chance of forcing k2 to generate external links even if we won't add http:// to the extra field link box?

what i'm trying to do here is this... add www.test.com to a link type extra field and show www.test.com linked in frontend, instead of mydomain.com/www.test.com

I tried to mess around with administrator\components\com_k2\models\extrafield.php cause i thought that this file is the one that generates the links, but with no luck

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 4 months ago - 8 years 4 months ago #149829 by Krikor Boghossian
Replied by Krikor Boghossian on topic Absolute links are turned into relative links
You can use a text extrafield and in your template overrides force a http:// in front of the link if it is not present.
You can use PHP's str_replace() and/or preg_replace functions.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Last edit: 8 years 4 months ago by Krikor Boghossian.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum