Keyword

SEO and Alt text issues Again! lol

  • Nate Hunter
  • Nate Hunter's Avatar Topic Author
  • Offline
  • New Member
More
7 years 7 months ago #160470 by Nate Hunter
SEO and Alt text issues Again! lol was created by Nate Hunter
OK so I am doing an SEO Audit and I need to make it so that the item image caption is made into the image alt text.
We are using the K2 image cache so the image names look like gobbledygook so the Alt tag becomes super important. Also, since the site was built, none of the images have any alt text associated with them so I need to do this asap. (a google seo audit made this abundantly clear.

So a programmatic answer is better than manually adding alt text to every image.

I saw and implemented the code from

I created a new field with the alias of ImgAlt

I put this code in the file in k2/models/item.php
function prepareFeedItem(&$item)
	{

		JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');
		$params = K2HelperUtilities::getParams('com_k2');
		$limitstart = 0;
		$view = JRequest::getCmd('view');
		//Category
		$category = JTable::getInstance('K2Category', 'Table');
		$category->load($item->catid);
		$item->category = $category;
		$item->extra_fields = $this->getItemExtraFields($item->extra_fields->ImgAlt, $item); /*added  by Nate 2/16 to ad alt attribute to SHB K2 editor see this link for details https://www.joomlaworks.net/forum/k2-en/47198-replace-k2-rss-image-with-an-extra-field-value*/
This worked beautifully but I realized that this is an extra step, on a separate tab, and my client will most likely forget to do this regularly.

So what I would like to do is make it a seamless workflow for my client. and since they already use the Item image Caption field I thought it would be easier to just make the caption the alt text.

I'm just not a PHP guru so not really sure how to accomplish this.

Thanks for your help!

P.S. Why is this not a core enhancement yet? I have seen posts in the forum going back to 2011 on this topic.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #160486 by Krikor Boghossian
Replied by Krikor Boghossian on topic SEO and Alt text issues Again! lol
This code builds the feed (RSS) item, it has nothing to do with alt tags.
The alt tag, captions etc are available in your template.

You need to double check your overrides to see if you are using the alt tags properly.

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

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

  • Nate Hunter
  • Nate Hunter's Avatar Topic Author
  • Offline
  • New Member
More
7 years 7 months ago #160494 by Nate Hunter
Replied by Nate Hunter on topic SEO and Alt text issues Again! lol
ok i see how this would be the RSS feed builder but then why did my image not have an alt text before i made this change and now it does have an alt text?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #160551 by Krikor Boghossian
Replied by Krikor Boghossian on topic SEO and Alt text issues Again! lol
Can you send me a link to your site?

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

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

  • Nate Hunter
  • Nate Hunter's Avatar Topic Author
  • Offline
  • New Member
More
7 years 7 months ago #160552 by Nate Hunter
Replied by Nate Hunter on topic SEO and Alt text issues Again! lol
the site is www.studenthousingbusiness.com but I think it may be a module rendering issue as it is only happening on the homepage article display modules.

I am talking to Gavick the developer of the module to see if that is what is causing the alt text from not showing up.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #160610 by Krikor Boghossian
Replied by Krikor Boghossian on topic SEO and Alt text issues Again! lol
This is indeed a template issue.
The default module by default contains the alt tag.

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