Improve default value for tags
When there are no tags for a page and you edit the page, the default tag is 0
Leave a comment
This is actually resolved by modifying the Tag module. See http://community.impresscms.org/modules/newbb/viewtopic.php?post_id=41871* forumpost41871
Open modules/tag/include/formtag.php and find the section labeled //itemid. Change it to this
// itemid
if( is_numeric($value) is_object($GLOBALS['xoopsModule']) ){
$modid = $GLOBALS['xoopsModule']->getVar('mid');
$tag_handler = xoops_getmodulehandler('tag', 'tag');
if($tags = $tag_handler->getByItem($value, $modid, $catid)) {
$value = htmlspecialchars(implode(', ', $tags));
} else {
$value = NULL;
}
}
Open modules/tag/include/formtag.php and find the section labeled //itemid. Change it to this
// itemid
if( is_numeric($value) is_object($GLOBALS['xoopsModule']) ){
$modid = $GLOBALS['xoopsModule']->getVar('mid');
$tag_handler = xoops_getmodulehandler('tag', 'tag');
if($tags = $tag_handler->getByItem($value, $modid, $catid)) {
$value = htmlspecialchars(implode(', ', $tags));
} else {
$value = NULL;
}
}