Hi
I'm making some customization on the metatags to incorporate some extra fields related to other module ( bookx )
I can do this by altering the meta_tags.php ( overinding, etc ), but I was trying to use the notifiers to do it, so I woundt'n need to mess with that file.
I'm using this notifier
$zco_notifier->notify('NOTIFY_MODULE_META_TAGS_OVERRIDE', $metatag_page_name, $meta_tags_over_ride, $metatags_title, $metatags_description, $metatags_keywords);
And this is a example how I'm calling it (?) (I've learn this way)
Code:
function __construct() {
global $zco_notifier;
$notifyme = array();
$notifyme[] = 'NOTIFY_MODULE_META_TAGS_OVERRIDE';
$this->attach($this, $notifyme);
}
function update(&$callingClass, $notifier, $paramsArray) {
if ( $notifier == 'NOTIFY_MODULE_META_TAGS_OVERRIDE' ) {
$this->tpl_pb_insertMetaTagsFilters($callingClass, $notifier, $paramsArray);
}
ok, I've pretty much done all I had to do related to other pages of this modules ( authors, publishers, etc... ) . But to add some more stuff in the products page metatags ( in this case, book fields such as ISBN, etc ), I'm having difficulty, and not sure if this is possible, just using a notifier.
So I can access the $product_info_metatags, etc, I just can't seen to add stuff to those variables ( title, description, keywords).
Example ( to add a book subtitle to the meta_products_name :
PHP Code:
function tpl_pb_insertMetaTagsFilters(&$callingClass, $notifier, $paramsArray) {
global $db, $current_page, $og_type, $og_image, $og_title, $og_author_books, $flag_page, $metatags_title, $meta_tags_over_ride, $metatag_page_name, $metatags_keywords, $metatags_description;
global $product_info_metatags, $meta_products_name ,$meta_products_price, $meta_products_description;
switch ( $metatag_page_name ) {
case 'index':
// etc, etc, working ok for other pages!
break;
// FOR THE PRODUCT PAGE
case (strstr($_GET['main_page'], 'product_') or strstr($_GET['main_page'], 'document_')):
if ( (isset($_GET['products_id']) && $current_page == 'product_bookx_info' ) ) {
if ( !empty($product_info_metatags->fields['metatags_keywords']) or ! empty($product_info_metatags->fields['metatags_description']) ) {
$meta_products_name = zen_clean_html($meta_products_name . $metatag_subtitle);
} else {
if ( $metatag_subtitle != '' ) {
$meta_products_name = zen_clean_html($meta_products_name . $metatag_subtitle);
}
}
define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name . $meta_products_price . PRIMARY_SECTION . TITLE . TAGLINE));
}
}
.... but it's not working....
All I can do for the products page, is to use the other NOTIFY_MODULE_START_META_TAGS, and change the file meta_tags.php directly
Thanks
Bookmarks