
Originally Posted by
clydejones
Remove the highlighted portions from the following code:
break;
//TESTIMONIALS:
case 'display_all_testimonials':
$sql = "select * from " . TABLE_TESTIMONIALS_MANAGER . " where status = 1 and language_id = '" . (int)$_SESSION['languages_id'] . "' order by date_added DESC, testimonials_title";
$testimonials = $db->Execute($sql);
while (!$testimonials->EOF) {
$testimonial_string_metatags .= zen_clean_html($testimonials->fields['testimonials_title']) . METATAGS_DIVIDER;
$testimonials->MoveNext();
} //EOF
define('META_TAG_TITLE', META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER_ALL_TESTIMONIALS . $testimonial_string_metatags);
define('META_TAG_DESCRIPTION', META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER_ALL_TESTIMONIALS . $testimonial_string_metatags);
define('META_TAG_KEYWORDS', META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER_ALL_TESTIMONIALS . $testimonial_string_metatags);
break;
case 'testimonials_manager':
define('META_TAG_TITLE', META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER . $page_check->fields['testimonials_title']);
define('META_TAG_DESCRIPTION', META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER . zen_trunc_string($page_check->fields['testimonials_html_text'],TESTIMONIALS_MANAGER_DESCRIPTION_LENGTH));
define('META_TAG_KEYWORDS', META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER . $page_check->fields['testimonials_title']);
Ok, so I tried that and unfortunately it didn't seem to work. I poked around a bit and tried this which seems to work ok:
I found the following line in /includes/modules/my_template/meta_tags.php
Code:
// NO "break" here. Allow defaults if not overridden at the per-page level
And added your following code directly above it (all I did was remove the "display_all_testimonials" page releveant code)
Code:
// Testimonials:
case 'testimonials_manager':
define('META_TAG_TITLE', $page_check->fields['testimonials_title']);
define('META_TAG_DESCRIPTION', zen_trunc_string($page_check->fields['testimonials_html_text'],TESTIMONIALS_MANAGER_DESCRIPTION_LENGTH));
define('META_TAG_KEYWORDS', $page_check->fields['testimonials_title']);
break;
I have very little knowledge of php and would appreciate if you could check that the above looks ok.
Then all I had to do was to define description, title and keywords for the display_all_testimonials page, I did that via the built in Zen Cart Per-Page meta-tags function in the includes/languages/english/my_template/meta_tags.php file like so:
Code:
// Per-Page meta-tags.
// Page: DISPLAY_ALL_TESTIMONIALS
define('META_TAG_DESCRIPTION_DISPLAY_ALL_TESTIMONIALS','A description here');
define('META_TAG_KEYWORDS_page_name','keywords, go, here');
define('META_TAG_TITLE_page_name', 'Page title here');
Testing on my local site seems to look ok so far..
Bookmarks