Glossary: changing term link to href="#"
Posted: Tue Jul 24, 2007 10:48 am
Hi,
I want to create CSS tooltips for glossary terms (terms listed left, tooltips appearing right when hovering with the mouse).
To realise this I need an "empty" link with href="#". But...
...changing the "function CreateTermLink" in glossary.module.php (line 307) to this
...takes no effect. Normally now the link should be href="#" regardless the settings for pretty_urls etc.
But actually the link is unchanged:
http://.../index.php?mact=Glossary,cntnt01,show,0&cntnt01cat=EMA&cntnt01tid=7&cntnt01returnid=34
Maybe there's another module for creating the link, i.e. the modredirect.inc.php in lib/classes/module_support/ ? Is it possible to deactivate this functionality for the glossary module?
Some hint would be nice...
Thanks in advance.
I want to create CSS tooltips for glossary terms (terms listed left, tooltips appearing right when hovering with the mouse).
To realise this I need an "empty" link with href="#". But...

...changing the "function CreateTermLink" in glossary.module.php (line 307) to this
Code: Select all
function CreateTermLink($term, $safeTermSrc, $termid, $def, $inline=true, $targ='', $show_single=false, $cat='')
{
global $gCms;
$config =& $gCms->GetConfig();
$safeTerm = preg_replace('/[^a-zA-Z]/',"",$safeTermSrc);
if ($inline)
{
if ($config['internal_pretty_urls'])
{
$lnk = '<a class="glossary" href="#"';
$lnk .= ' title="'.substr(htmlspecialchars(strip_tags($def)),0,128).'">'.$term.'</a>';
// $lnk = '<a class="glossary" href="'. $config['root_url'] . '/glossary';
// $lnk .= ($show_single?'sing':'');
// $lnk .= '/'.$termid;
// $lnk .= (($cat != '')?'/'.$cat:'');
// $lnk .= '/'.$gCms->variables['content_id'];
// $lnk .= '" title="'.substr(htmlspecialchars(strip_tags($def)),0,128).'">'.$term.'</a>';
}
else
{
$lnk = '<a class="glossary" href="#"';
$lnk .= ' title="'.substr(htmlspecialchars(strip_tags($def)),0,128).'">'.$term.'</a>';
// $lnk = '<a class="glossary" href="'. $config['root_url'] . '/index.php?mact=Glossary,cntnt01,';
// $lnk .= ($show_single?'showsingle':'show');
// $lnk .= ',1&cntnt01tid=' . $termid .'&cntnt01returnid='.$gCms->variables['content_id'];
// $lnk .= (($cat != '')?'&cat='.$cat:'');
// $lnk .= '&page='.$gCms->variables['content_id'];
// $lnk .= ($show_single?'':'#'.$safeTerm);
// $lnk .= '" title="'.substr(htmlspecialchars(strip_tags($def)),0,128).'">'.$term.'</a>';
}
return $lnk;
}
else
{
$lnk = '<a class="glossary" href="#"';
$lnk .= ' title="'.substr(htmlspecialchars(strip_tags($def)),0,128).'">'.$term.'</a>';
// $lnk = '<a class="glossary" href="'.$config['root_url'];
// $lnk .= '/index.php?page='.$targ.'&tid='.$termid;
// $lnk .= (($cat != '')?'&cat='.$cat:'');
// $lnk .= '#'.$safeTerm.'" title="'. substr(htmlspecialchars(strip_tags($def)),0,128).'">'.$term.'</a>';
return $lnk;
}
}
...takes no effect. Normally now the link should be href="#" regardless the settings for pretty_urls etc.
But actually the link is unchanged:
http://.../index.php?mact=Glossary,cntnt01,show,0&cntnt01cat=EMA&cntnt01tid=7&cntnt01returnid=34
Maybe there's another module for creating the link, i.e. the modredirect.inc.php in lib/classes/module_support/ ? Is it possible to deactivate this functionality for the glossary module?
Some hint would be nice...
Thanks in advance.