Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use the description of the first tagged item for the DESCRIPTION tag.

Signed-off-by: Bharat Mediratta <bharat@menalto.com>
  • Loading branch information...
commit 72b2b0374396deea0d3b3dc0ffe476f8520b566a 1 parent 40b669e
rWatcher authored bharat committed
Showing with 7 additions and 0 deletions.
  1. +7 −0 modules/metadescription/views/metadescription_block.html.php
View
7 modules/metadescription/views/metadescription_block.html.php
@@ -23,10 +23,17 @@
if ($metaDescription == "") {
$metaDescription = p::clean($item->title);
}
+ // If this page belongs to a tag, use the description of the first item instead.
+ if ($theme->tag()) {
+ if (count($children) > 0) {
+ $metaDescription = trim(nl2br(p::purify($children[0]->description)));
+ }
+ }
// If it's still empty, use $metaTags.
if ($metaDescription == "") {
$metaDescription = $metaTags;
}
+
// Strip HTML
$metaDescription = strip_tags($metaDescription);
// Strip Line Breaks
Please sign in to comment.
Something went wrong with that request. Please try again.