have you added any testimonials in chinese?
Printable View
Hi Clyde,
I've had a dig around this thread and can't find an answer so here goes.
Title tag and meta description: is it possible for each testimonial (index.php?main_page=testimonials_manager&testimonials_id=XX) to have it's own unique title tag and meta description generated, the same way that Zen Cart generates a unique title tag and meta description for each product based on it's name/description etc.
Thanks :smile:
Hmmmmmm! did you check this post
Ok so I've had a go, and have experienced the same problems as a few other people on this thread.
I've done this, then this and finally this.
The result is:
"META_TAG_TITLE_PAGE_TESTIMONIALS_MANAGER_ALL_TESTIMONIALSTestimonial, Titles, Here" as the title on the display_all_testimonials page.
And:
"Testimonial - (blank)" as the title on the testimonials_manager&testimonials_id=XX pages.
:blink:
What I was thinking I might try was to define description, title and keywords for the display_all_testimonials page via the built in Zen Cart Per-Page meta-tags function in the includes\languages\english\my_template\meta_tags.php file and use only the "testimonials_manager" part of your method to display auto-generated titles/description/keyword tags on the testimonials_id=XX pages - only problem is that I don't know which parts to leave and which parts to delete..
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.phpAnd added your following code directly above it (all I did was remove the "display_all_testimonials" page releveant code)Code:// NO "break" here. Allow defaults if not overridden at the per-page level
I have very little knowledge of php and would appreciate if you could check that the above looks ok.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;
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:
Testing on my local site seems to look ok so far..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');
Looks fine.
Sorry to string this out over soooo many posts Clyde, but I have just one more very quick question.
Is it possible to add my sites title & tagline after the testimonials title in the following code:
Thanks.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;
You should be able to add them as indicated by the highlight.
Code:// Testimonials:
case 'testimonials_manager':
define('META_TAG_TITLE', $page_check->fields['testimonials_title'] . TITLE . TAGLINE);
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;