Wednesday, May 23rd

Last update05:36:30 AM GMT

Font Size

Screen

Profile

Layout

Menu Style

Cpanel
Welcome, Guest
Username Password: Remember me

K2 and SH404SEF
(1 viewing) (1) Guest
Got a Joomla problem? Post as much detail about it as you can here to see if you can get a solution.

Where possible, include URL for the site or page having issues, what version of Joomla you're using, what type of server (eg Cpanel, WAMP, IIS), what components may be installed, and specific error messages you're encountering.

If you think your problem is particularly obscure, you might be better posting it to the forums at joomla.org as there's thousands more people to help you.
  • Page:
  • 1

TOPIC: K2 and SH404SEF

K2 and SH404SEF 6 months, 2 weeks ago #5196

  • MartinB
  • OFFLINE
  • Expert Boarder
  • Posts: 90
  • Karma: 0
Hi all,

Not being a SH404SEF user and having not found the answer on the anything-digital site - I'm wondering if any of the regular SH404SEF users can advise if it supports "custom" meta tags for K2, specifically at the category level ?

If not, any idea how to set custom meta descriptions and keywords for K2 categories ?

Thanks,

Oh btw - this is a 1.5 J! site using K2 2.4.1 at the moment.
Last Edit: 6 months, 2 weeks ago by MartinB. Reason: extra info

Re: K2 and SH404SEF 6 months, 2 weeks ago #5226

  • Partic
  • OFFLINE
  • Moderator
  • Posts: 341
  • Karma: 21
Not out of the box without a SEF plugin.

Sh404SEF only puts in it's custom meta data when it's actually been manually entered and plugin applies to that component.

So if the component itself is driving the meta tags, then it won't be adjusted by sh404SEF unless you do some custom titles and descriptions and have the plugin in play.

You might need to find the latest build of the SEF plugin in the K2 forums to see if it does what you're after.
Patrick Jackson
www.kpsystems.com.au
Ask Anything Joomla and I'll helpfully tell you where to go

Re: K2 and SH404SEF (How to set K2 category metadata) 6 months, 2 weeks ago #5227

  • MartinB
  • OFFLINE
  • Expert Boarder
  • Posts: 90
  • Karma: 0
Hi Patrick

Thanks for the info. As I see it the site doesn't need all the bells & whisles that SH404SEF offers, just "boring" metadata at the K2 category level, as it seems that by default you can't set this.

I had searched the K2 forums, but not that well it seems, as I found this post today that resolves the issue - as least from what I can see.

community.getk2.org/forum/topics/categor...4%3AComment%3A165537

The resolution is as follows -

----DB CHANGE/UPDATE--------------add
ALTER TABLE `jos_k2_categories` ADD `metadesc` text NOT NULL

ALTER TABLE `jos_k2_categories` ADD `metakey` text NOT NULL



-----administrator/components/com_k2/tables---------

var $metadata = null;
var $metadesc = null;
var $metakey = null;

------components/com_k2/templates/default/category.php----------add

// no direct access
defined('_JEXEC') or die('Restricted access');
/* Add AtLeast AutoMetadata - Hack */
$mainframe->prependMetaTag( "keywords", substr(strip_tags($this->category->metakey ), 0, 255) );
$mainframe->prependMetaTag( "description", substr(strip_tags($this->category->metadesc ), 0, 255) );



---------administrator/components/com_k2/views/category/tmpl/default.php-----------add

<table class="admintable">
<tr>
<td align="right" class="key"><?php echo JText::_('Description'); ?></td>
<td><textarea rows="5" name="metadesc" cols="30"><?php echo $this->row->metadesc; ?></textarea></td>
</tr>
<tr>
<td align="right" class="key"><?php echo JText::_('Keywords'); ?></td>
<td><textarea rows="5" name="metakey" cols="30"><?php echo $this->row->metakey; ?></textarea></td>
</tr>
</table>
</td>
</tr>

</tbody>
</table>


-----------------------

Thanks to erme & Lukas over at the K2 forums. It would be nice if the folks at K2 incorporated this into the next release

Re: K2 and SH404SEF (How to set K2 category metadata) 6 months, 2 weeks ago #5228

  • MartinB
  • OFFLINE
  • Expert Boarder
  • Posts: 90
  • Karma: 0
Well after ensuring I had a good back up I gave this a go - good news all works perfectly

I did have to ensure I applied the changes to the correct category.php as I'm using a k2 template overide.
  • Page:
  • 1
Moderators: Partic
Time to create page: 0.48 seconds
You are here: Forum