WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.6 is now available!


Will it continue with WB? It goes on! | Geht es mit WB weiter? Es geht weiter!
https://forum.websitebaker.org/index.php/topic,32340.msg226702.html#msg226702


The forum email address board@websitebaker.org is working again
https://forum.websitebaker.org/index.php/topic,32358.0.html


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Template Industry: How to keep one menu link highlighted after clicking on it?
  • Print
Pages: [1]   Go Down

Author Topic: Template Industry: How to keep one menu link highlighted after clicking on it?  (Read 14037 times)

Offline midiweb

  • Posts: 181
Template Industry: How to keep one menu link highlighted after clicking on it?
« on: November 12, 2008, 12:32:35 AM »
hi, i use the templates industry1.
How to keep the menu links highlighted (a:hover,a:active) after clicking on it?
What have to change in the css? Thanks
Here's my piece of code:
Code: [Select]

}
#sidebar h3 {
font-size : 18px;
border-bottom : 1px solid black;
margin-bottom : 4px;
margin-top : 16px;
clear : both;

}
#sidebar ul {
margin-left : 1em;
padding-left : 0;
}
#sidebar p {
margin-bottom : 8px;
}
#sidebar div.subtabs ul {
list-style : none;
width : 155px;
margin : 0;
padding : 0;
}
#sidebar div.subtabs ul ul {
list-style : none;
width : 130px;
margin : 0;
padding : 0 0 0 5px;
}
#sidebar div.subtabs ul ul ul {
list-style : none;
width : 125px;
margin : 0;
padding : 0 0 0 5px;
}
#sidebar div.subtabs ul a {
width : 100%;
margin : 3px;
text-align : left;
text-decoration : none;
display : block;
padding : 3px 3px 3px 5px;
border-bottom : 1px solid #949494;
border-left : 4px solid #cccccc;
font: bold 0.8em Verdana, Arial, Helvetica, sans-serif;
}
#sidebar div.subtabs ul a:hover {
text-decoration : none;
background : #eaeaea url(img/menubg2.gif) repeat-x left;
color : #da0434;
border-left : 4px solid #110200;
}
   
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Template Industry: How to keep one menu link highlighted after clicking on i
« Reply #1 on: November 12, 2008, 03:44:59 AM »
Hello.

I tried to find the Template "Industry1" but I can't find it at the repository.

If you can provide the menu call from this template (show_menu or show_menu2) it would help.

If you want to have the current link highlighted it's not a css "problem". You have to adjust the menu call first.

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

vyni

  • Guest
Re: Template Industry: How to keep one menu link highlighted after clicking on it?
« Reply #2 on: November 12, 2008, 10:40:56 AM »
Hi midiweb,

just add a class menu_current to Your industry.css

.menu_current {
    background-color: #666666;
}

than it will stay grey.

regards from Himberg
Logged

Offline midiweb

  • Posts: 181
Re: Template Industry: How to keep one menu link highlighted after clicking on it?
« Reply #3 on: November 12, 2008, 01:27:44 PM »
hi, thanks. I mean with "highlighted" (sorry, 'im french native), not the background but the font. When I click on,  for instance: menuentry, then I read the text, but my link stays highlighted:
menuentry, in order to know where I am in the menu
Logged

vyni

  • Guest
Re: Template Industry: How to keep one menu link highlighted after clicking on it?
« Reply #4 on: November 12, 2008, 01:39:50 PM »
Than set the color:

.menu_current {
   background-color: #666666;
   color: #ffffff;
}

this will give You grey background - same than mouseover - AND white text for the menu-link

remove background-color if You don´t like it
add any line (example: font-weight: bold;) within the two brackets {  }

this is just standard css
Logged

Offline midiweb

  • Posts: 181
Re: Template Industry: How to keep one menu link highlighted after clicking on it?
« Reply #5 on: November 13, 2008, 11:23:16 PM »
Hi, here's the index.php for the industry css. Where have I to pass on the css code?

Code: [Select]
<?php[table][/table]



if(!defined(&#39;WB_URL&#39;)) {
    header(&#39;Location: ../index.php&#39;);
    exit(0);
}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title><?php echo WEBSITE_TITLE; ?> - <?php echo PAGE_TITLE; ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=<?php if(defined(&#39;DEFAULT_CHARSET&#39;)) { echo DEFAULT_CHARSET; } else { echo &#39;utf-8&#39;; }?>" />
        <meta name="description" content="<?php page_description(); ?>" />
        <meta name="keywords" content="<?php page_keywords(); ?>" />

        <link href="<?php echo TEMPLATE_DIR; ?>/industry.css" rel="stylesheet" type="text/css" media="screen" />
    </head>
    <body>
        <div id="main">
            <a name="top" class="nodisplay"></a>
            <div id="hero"> </div>
                        <div id="hero2"> </div>
            <div id="header">
                <!-- <div class="gear"> </div> -->
                <div class="gear"> </div>
                        <?php show_menu(1,0,1,true,&#39;<li><span[class]>[a][menu_title] [/a]</span>&#39;,&#39;</li>&#39;,&#39;<ul id="nav">&#39;); ?>

                <h1 class="shad"><em><?php echo WEBSITE_TITLE; ?></em></h1>
                <h1><em><?php echo WEBSITE_TITLE; ?></em></h1>
            </div>

            <div id="wrapper">
                <div id="sidebar">
                    <div class="subtabs">
                        <?php show_menu2(2,0,1); ?>
                    </div>
                    <?php 
                        ob_start
();     // start output buffer
                        
global $database;
                        
$limit = 10;
                        
$query = "SELECT post_id,title,content_short,group_id,link FROM ".TABLE_PREFIX."mod_news_posts ORDER BY position DESC LIMIT 0, $limit;";
                        
$error = mysql_error();
                        if (!
$result = mysql_query($query)) {
                            print 
"$error";
                            exit;
                        }
                        while(
$data = mysql_fetch_object($result)){
                            
$title = $data->title;
                            
$id = $data->post_id;
                            
$link = $data->link;
                            
$short = $data->content_short;
                            echo &
#39;<p><a href="&#39;.WB_URL.&#39;/pages/&#39;.$link.PAGE_EXTENSION.&#39;">&#39;.$title.&#39;</a><br />&#39;.$short.&#39;</p>&#39;;
                        
}
                        
$foo=ob_get_contents();    // put outputbuffer in $foo
                        
ob_end_clean();             // clear outputbuffer
                    
?>

                </div>
                <div id=aktuelles>
                <?
                    if ($foo<>"") {  // some code to execute cause there is some block
                            echo '<h4>Aktuelles</h4>';
                            echo $foo;
                        } else { // some code for no info
                            echo '<h1>No New News</h1>';
                            }
                ?>
                </div>

                <div id="content">
                    <?php page_content(); ?>
                </div>
                            </div>
           
            <div id="footer">
                <?php page_footer(); ?>
            </div>
        <div style="clear:both;"></div>
    </div>

    </body>
</html>
Logged

vyni

  • Guest
Re: Template Industry: How to keep one menu link highlighted after clicking on it?
« Reply #6 on: November 13, 2008, 11:29:30 PM »
Hey,
this must be added in the file industry.css - not in index.php

But what about reading the designer-Guide to find out how to make/modify a template?

regards Vyni
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Template Industry: How to keep one menu link highlighted after clicking on i
« Reply #7 on: November 14, 2008, 01:08:50 AM »
Quote from: vyni on November 12, 2008, 01:39:50 PM
.menu_current {
   background-color: #666666;
   color: #ffffff;
}


According to the show_menu2 "Read-Me-File"
you have to use
.menu-current not .menu_current  :wink:

@midiweb
Please read the Help Sites => Creating a WB Template


Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

vyni

  • Guest
Re: Template Industry: How to keep one menu link highlighted after clicking on it?
« Reply #8 on: November 14, 2008, 02:47:57 AM »
@Stefek

Quote
Ich kann grad was lesen, kopieren und einfügen

Trust in me - I´m a copy & paste - specialist.
Logged

Offline Stefek

  • Posts: 6177
  • Gender: Male
  • ("ړ)
Re: Template Industry: How to keep one menu link highlighted after clicking on i
« Reply #9 on: November 14, 2008, 04:28:15 AM »
I do.
From the first time you contacted me via PM  :wink:

I mostly trust in your humor  :-D

Regards,
Stefek
Logged
"Gemeinsam schafft man mehr."

gemeinsam
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

groloff

  • Guest
Re: Template Industry: How to keep one menu link highlighted after clicking on it?
« Reply #10 on: November 14, 2008, 06:23:59 PM »
hey guys, thanks a lot. for both the question and the answer. the a:active not working was driving me mad.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Template Industry: How to keep one menu link highlighted after clicking on it?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2