Hello,
3 questions about the sitemap:
1) How can i move the ââ,¬Â¢Downloads section to the bottom, or any other part of the sitemap?
2) How can i change the little icon before the links in the sitemap to look like the Downloads one?
3) When you click on the Downloads link, the "Downloads" in the sitemap turns darker, how can i add that effect to the rest?
Thanks
You can't do any of this without altering the code. Since you want so much modifications to your menu you should just create a custom menu from one of the code snippets.
The most important thing would be moving the Downloads button to the bottom. Is it possible to do just that?
Thanks
The code in the TPortalBlocks.template.php file is where you'll want to try and get that to work.
// Tportal sitemap menu
function TPortal_sitemap()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$current='';
// check where we are
if(isset($_GET['action']) && $_GET['action']=='tpmod'){
if(isset($_GET['dl']))
$current='dl';
elseif(isset($_GET['link']))
$current='link';
elseif(isset($_GET['show']))
$current='show';
elseif(isset($_GET['team']))
$current='team';
else
$current='';
}
echo '
<div class="tborder">
<ul style="margin: 0; padding: 0; list-style: none;" class="sitemap">';
if($context['TPortal']['show_download']=='1')
echo '<li><a class="sitemap_header' , $current=='dl' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;dl"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-dldownloads'].'</a></li>';
if($context['TPortal']['show_gallery']=='1')
echo '<li><a class="sitemap_header' , $current=='show' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;show"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-admin15'].'</a></li>';
if($context['TPortal']['show_linkmanager']=='1')
echo '<li><a class="sitemap_header' , $current=='link' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;link"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-admin13'].'</a></li>';
if($context['TPortal']['show_teampage']=='1')
echo '<li><a class="sitemap_header' , $current=='team' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;team"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-admin17'].'</a></li>';
if(!empty($context['TPortal']['sitemap']) && !empty($context['TPortal']['menu'])){
foreach($context['TPortal']['menu'] as $cn){
// check if we can find the link on current tpage
$catclass = 'sitemap_header';
if($cn['type']=='cats'){
if(is_int(strpos($context['TPortal']['querystring'],'cat='.$cn['IDtype'])))
$catclass .= '_active';
}
elseif($cn['type']=='arti'){
if(is_int(strpos($context['TPortal']['querystring'],'page='.$cn['IDtype'])))
$catclass .= '_active';
}
elseif($cn['type']=='link'){
if(!empty($context['TPortal']['querystring']))
$qs=$scripturl.'?'.$context['TPortal']['querystring'];
else
$qs=$scripturl;
if($qs==$cn['IDtype'])
$catclass .= '_active';
else
$catclass .= '';
}
if($cn['sitemap']=='1'){
switch($cn['type']){
case 'cats' :
echo '<li><a class="' , $catclass ,'" href="'. $scripturl. '?cat='.$cn['IDtype'].'" ' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '><img src="',$settings['images_url'],'/TPdivider.gif" border="0" alt="" /> '.$cn['name'].'</a></li>';
break;
case 'arti' :
echo '<li><a class="' , $catclass ,'" href="'. $scripturl. '?page='.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '><img src="',$settings['images_url'],'/TPdivider.gif" border="0" alt="" /> '.$cn['name'].'</a></li>';
break;
case 'link' :
echo '<li><a class="' , $catclass ,'" href="'.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '><img src="',$settings['images_url'],'/TPdivider.gif" border="0" alt="" /> '.$cn['name'].'</a></li>';
break;
}
}
}
}
echo '</ul></div>';
}
Let me know if you need help.
I substitute the sitemap for the menu manager where I place a link for the downloads module, it is much the same and allows me to customize it to my heart's content. ;)
Ok, done :)
This is the code to see the Downloads and the other 3 "special" categories at the end of the sitemap:
// Tportal sitemap menu
function TPortal_sitemap()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;
$current='';
// check where we are
if(isset($_GET['action']) && $_GET['action']=='tpmod'){
if(isset($_GET['dl']))
$current='dl';
elseif(isset($_GET['link']))
$current='link';
elseif(isset($_GET['show']))
$current='show';
elseif(isset($_GET['team']))
$current='team';
else
$current='';
}
echo '
<div class="tborder">
<ul style="margin: 0; padding: 0; list-style: none;" class="sitemap">';
if(!empty($context['TPortal']['sitemap']) && !empty($context['TPortal']['menu'])){
foreach($context['TPortal']['menu'] as $cn){
// check if we can find the link on current tpage
$catclass = 'sitemap_header';
if($cn['type']=='cats'){
if(is_int(strpos($context['TPortal']['querystring'],'cat='.$cn['IDtype'])))
$catclass .= '_active';
}
elseif($cn['type']=='arti'){
if(is_int(strpos($context['TPortal']['querystring'],'page='.$cn['IDtype'])))
$catclass .= '_active';
}
elseif($cn['type']=='link'){
if(!empty($context['TPortal']['querystring']))
$qs=$scripturl.'?'.$context['TPortal']['querystring'];
else
$qs=$scripturl;
if($qs==$cn['IDtype'])
$catclass .= '_active';
else
$catclass .= '';
}
if($cn['sitemap']=='1'){
switch($cn['type']){
case 'cats' :
echo '<li><a class="' , $catclass ,'" href="'. $scripturl. '?cat='.$cn['IDtype'].'" ' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '><img src="',$settings['images_url'],'/TPdivider.gif" border="0" alt="" /> '.$cn['name'].'</a></li>';
break;
case 'arti' :
echo '<li><a class="' , $catclass ,'" href="'. $scripturl. '?page='.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '><img src="',$settings['images_url'],'/TPdivider.gif" border="0" alt="" /> '.$cn['name'].'</a></li>';
break;
case 'link' :
echo '<li><a class="' , $catclass ,'" href="'.$cn['IDtype'].'"' , $cn['newlink']=='1' ? 'target="_blank"' : '' , '><img src="',$settings['images_url'],'/TPdivider.gif" border="0" alt="" /> '.$cn['name'].'</a></li>';
break;
}
}
}
}
if($context['TPortal']['show_download']=='1')
echo '<li><a class="sitemap_header' , $current=='dl' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;dl"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-dldownloads'].'</a></li>';
if($context['TPortal']['show_gallery']=='1')
echo '<li><a class="sitemap_header' , $current=='show' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;show"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-admin15'].'</a></li>';
if($context['TPortal']['show_linkmanager']=='1')
echo '<li><a class="sitemap_header' , $current=='link' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;link"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-admin13'].'</a></li>';
if($context['TPortal']['show_teampage']=='1')
echo '<li><a class="sitemap_header' , $current=='team' ? '_active' : '' , '" href="'.$scripturl.'?action=tpmod;team"><img src="',$settings['images_url'],'/tpmodule2.gif" border="0" alt="" /> '.$txt['tp-admin17'].'</a></li>';
echo '</ul></div>';
}
Cya
EDIT: I see in the code some little blocks like if there were characters in other language... like ââ,,¢Â¦... in that code up here, but in the real one those aren't there... of course... just a note.