Keyword

[SOLVED] K2 EXTRAFIELD LINK TYPE

More
8 years 6 months ago #147065 by wols
K2 EXTRAFIELD LINK TYPE was created by wols
Hello,
How i can add rel="nofollow" to k2 extrafield link type?

Please help

Best regards!

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 6 months ago #147072 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic K2 EXTRAFIELD LINK TYPE
Hello,

Do you want to add this to a specific field or for all link type fields?

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
8 years 6 months ago #147080 by wols
Replied by wols on topic K2 EXTRAFIELD LINK TYPE
Hello,
i want to add it for all extrafield link type.

Thanks

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 6 months ago #147083 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic K2 EXTRAFIELD LINK TYPE
In the file components/com_k2/models/item.php, find this line:
$value = '<a href="'.$object->value[1].'" '.$attributes.'>'.$object->value[0].'</a>';

Replace it with this modified line:
$value = '<a rel="nofollow" href="'.$object->value[1].'" '.$attributes.'>'.$object->value[0].'</a>';

Take care to backup this change to reapply any K2 update, because this is a core hack.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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

More
8 years 6 months ago #147085 by wols
Replied by wols on topic K2 EXTRAFIELD LINK TYPE
thanks you very much.

I see something strange in the generated link,
<span class="itemExtraFieldsValue"><a href="<a rel="nofollow" href="www.site.com" target="_blank">Siteweb" target="_blank">www.site.com" rel="nofollow">text

Maybe you have an idea? the link is duplication and in the href

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

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
8 years 6 months ago #147088 by Mohamed Abdelaziz
Replied by Mohamed Abdelaziz on topic K2 EXTRAFIELD LINK TYPE
Make sure that you have closed the " properly.

Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store

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


Powered by Kunena Forum