Keyword

meta description not working

  • Spyros Jonas
  • Spyros Jonas's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #151830 by Spyros Jonas
meta description not working was created by Spyros Jonas
We have noticed that setting the meta description text for articles do not appear in the meta name="description" it continues to take the first 160 characters of the article. We have tried the work with the
if ($mainframe->getCfg('MetaDescription') == '1' && isset($item->description->name))
{
$introDescr = trim($item->description->name);

// $document->setMetadata('description', $item->description->name);
$document->setMetadata('description', htmlspecialchars(strip_tags($introDescr),ENT_QUOTES,'UTF-8'));

}

In the components/com_k2/views/item/view.html.php but it seems that item is not implemented. How can we set the item.
Any suggestion is welcomed.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 6 months ago #151842 by Krikor Boghossian
Replied by Krikor Boghossian on topic meta description not working
Hello,

Which version of K2 are you using?
Also these changes should be made in your overrides, not on core files.

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

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

  • Spyros Jonas
  • Spyros Jonas's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #151869 by Spyros Jonas
Replied by Spyros Jonas on topic meta description not working
Thanks for your rapid response.
(Last update: June 16th, 2014 - Version 2.7.0)
I believe that the file we should be altering are
public_html/templates/mytemplate/html/com_k2/templates/default/item.php
And the place that we need to do something should be in
<?php if(!empty($this->item->fulltext)): ?>
<?php if($this->item->params->get('itemIntroText')): ?>

<!-- Item introtext -->
<div class="itemIntroText"> <?php echo $this->item->introtext; ?> </div>
<?php endif; ?>
<?php if($this->item->params->get('itemFullText')): ?>
<!-- Item fulltext -->
<div class="itemFullText"> <?php echo $this->item->fulltext; ?> </div>
<?php endif; ?>
<?php else: ?>
<!-- Item text -->
<div class="itemFullText"> <?php echo $this->item->introtext; ?> <div class="clr"></div>

<?php endif; ?>

Your advise will be valuable

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

  • Spyros Jonas
  • Spyros Jonas's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #151929 by Spyros Jonas
Replied by Spyros Jonas on topic meta description not working
Is the information not sufficient, do you need more info as to reach to a reply. Sorry for urging you but we are stack with this issue for a few days and we simply do not know how to cope with it.
thanks S.

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

  • Spyros Jonas
  • Spyros Jonas's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #151930 by Spyros Jonas
Replied by Spyros Jonas on topic meta description not working
I would also like to point out that we are using the sh404SEF, the latest version and Joomla! version 3.4.8 is the current version.

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

  • Spyros Jonas
  • Spyros Jonas's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #151933 by Spyros Jonas
Replied by Spyros Jonas on topic meta description not working
It seems that the itemDescription is not set.
having the code
<?php echo '<script type="text/javascript">alert("' . $this->item->params->get('itemDescription') . '")</script>'; ?>

It simply brings an empty msgBox, assuming that the item is names itemDescription.
I do not know if this helps...

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
8 years 6 months ago #151953 by Krikor Boghossian
Replied by Krikor Boghossian on topic meta description not working
Are you using the latest version of sh404sef, frankly this seems like a conflict between these two extensions.

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

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

  • Spyros Jonas
  • Spyros Jonas's Avatar Topic Author
  • Offline
  • New Member
More
8 years 6 months ago #151958 by Spyros Jonas
Replied by Spyros Jonas on topic meta description not working
Yes it is the latest version. Where we could go in the code, and in which file, in order to verify that 'descirption' is set with data from the k2 metadescription field. Perhaps we should verify that this is not omitted in the code.

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

More
8 years 6 months ago #152010 by Lefteris
Replied by Lefteris on topic meta description not working
@Spyros Jonas

Just tested and the meta description works fine for me. I changed it at the item form and the text i entered is added at the meta description. Note that i used the 2.7.0 development version from github.com/getk2/k2/archive/master.zip .

Finally, i don't really get what you are trying to do. The code you are trying to use has nothing to do with K2. There is no $this->item->params->get('itemDescription') variable in K2. I don't know where you found this, but it will never work in K2.

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