Keyword

how to change alt tag from k2 image?

More
10 years 2 months ago - 10 years 2 months ago #132133 by luis
hi i wanted to know how to change the alt tag of an image from k2, i uploaded different articles and the images take the alt tag from the title of the article

im talking about the main image taken from the media folder (itemimage), not the other ones you can put inside the article
thx

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 2 months ago #132134 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: how to change alt tag from k2 image?
You need to override the item.php file.
In the alt tag you need to use $this->item->title;

This post will help you with overrides:
getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates

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

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

More
10 years 2 months ago #132135 by luis
Replied by luis on topic Re: how to change alt tag from k2 image?
i am new to this, but i want to customize the alt tag from the main k2 image of an article...


isnt that code $this->item->title; going to put the title (of the article) like alt tag??


ty

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

More
10 years 2 months ago - 10 years 2 months ago #132136 by Mr_Anonymous
Replied by Mr_Anonymous on topic Re: how to change alt tag from k2 image?
Thats right. It places the article title as the image alt for that k2 item image.

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

More
10 years 2 months ago #132137 by luis
Replied by luis on topic Re: how to change alt tag from k2 image?
do you know how can i customize the alt? , in other words how can i make it different from gettin the title name

ty

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

More
10 years 2 months ago #132138 by Mr_Anonymous
Replied by Mr_Anonymous on topic Re: how to change alt tag from k2 image?
You can edit it by creating template overrides like Krikore suggested. This will work if you have a pattern to use for all img alt. But if you want to change image Alt for each image individually, then it's not possible. What kind of alt info are you planning to add? Any particular reason you want to have a specific alt for images? Can you give examples?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 2 months ago #132139 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: how to change alt tag from k2 image?
You can also use K2's photo caption or credits.

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

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

More
10 years 1 month ago #132140 by luis
Replied by luis on topic Re: how to change alt tag from k2 image?
where is this k2 credits/photo caption?

i want to customize alt because of seo of images

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

More
10 years 1 month ago #132141 by luis
Replied by luis on topic Re: how to change alt tag from k2 image?
i found them! but are they going to change the alt? or is not possible to customize it then? ty

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 1 month ago #132142 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: how to change alt tag from k2 image?
You can use that fields as your image's alt tag.
This has to be done in your item.php file of course.

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

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


Powered by Kunena Forum