Keyword

Check if meta data is set in php template override

  • Andrew Paterson
  • Andrew Paterson's Avatar Topic Author
  • Offline
  • Junior Member
More
9 years 5 months ago #143083 by Andrew Paterson
Greetings

In item.php and category.php, is it possible to check whether or not the meta description field is empty?

I would like to display a warning on the front end to logged in admins, if they load a page which is missing the meta description.

I've tried things ike the below but no success:
<?php  if(isset($category->metaDescription)): ?>
           Display a warning about the lack of meta description.
        <?php endif; ?>

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #143139 by Krikor Boghossian
Replied by Krikor Boghossian on topic Check if meta data is set in php template override
How did you set the $category variable?
In general you can use var_dump($this) in the category.php file and ($this->item) to check the object's content.

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