Forums / Templates, Stylesheets, Page Layout / Making current page display in bold letters

Making current page display in bold letters

Views: 976

Results 1 to 8 of 8
29 Jul 2014, 2:32 PM
#1
togfather avatar

togfather

New Zenner

Join Date:
Dec 2009
Location:
Scotland
Posts:
76
Plugin Contributions:
0

Making current page display in bold letters

If I view one of the category pages, that page title appears in bold in the category sidebox.

Can anyone tell me the lines of code in includes/templates/template_default/sideboxes/tpl_categories.php
that make this happen.

If I can find this code I can then replicate it in the More Information sidebox, so that the current page being viewed is displayed as bold in the list.

Many Thanks

Tog

29 Jul 2014, 3:19 PM
#2
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Making current page display in bold letters

It's done by the css

SPAN.category-subs-parent {
    font-weight: bold;
}
29 Jul 2014, 8:50 PM
#3
togfather avatar

togfather

New Zenner

Join Date:
Dec 2009
Location:
Scotland
Posts:
76
Plugin Contributions:
0

Re: Making current page display in bold letters

Thanks David,

Unfortunately that makes things a bit more difficult for me as I cannot see the same piece of code for the More Information box. I tried adding
SPAN.More_information-subs-parent {
font-weight: bold;
}
But this did nothing, so I must need to add some code elsewhere too.

Best wishes

Tog

29 Jul 2014, 9:29 PM
#4
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Making current page display in bold letters

Hi Tog
To achieve what you want I think you would need to add some code to /includes/modules/sideboxes/information.php.
First copy this file to /includes/modules/sideboxes/YOUR_TEMPLATE/information.php
Then add the required code. For each of the links you need to check the variable $current_page:
eg for contact us page change existing code

  if (DEFINE_CONTACT_US_STATUS <= 1) {
    $information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a>';
  }

to

  if (DEFINE_CONTACT_US_STATUS <= 1) {
    $information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '"'.($current_page=='contact_us' ? ' class="infobold" : '').'>' . BOX_INFORMATION_CONTACT . '</a>';
  }

then in your css add

.infobold {font-weight:bold}

I haven't tested it - but that should get you started :)

Regards

29 Jul 2014, 10:07 PM
#5
togfather avatar

togfather

New Zenner

Join Date:
Dec 2009
Location:
Scotland
Posts:
76
Plugin Contributions:
0

Re: Making current page display in bold letters

Thanks David

Yes, that is the code that needs changing. Unfortunately your suggestion has an error somewhere, but I can't find it. If I use it as is I get the rest of the code on that page greyed out (Using Ultra Edit), and when the site is accessed everything after the information box has disappeared.

I think it is a syntax problem within the code in red above, but cannot see what the problem is. I have tried removing ' and substituting " in a couple of places but that does not help. I will play around some more with it as I am sure the answer is very close now.

Best wishes

Tog

29 Jul 2014, 10:34 PM
#6
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Making current page display in bold letters

Hi - think I see the problem

 if (DEFINE_CONTACT_US_STATUS <= 1) {     $information[] = '<a href="' . zen_href_link(FILENAME_CONTACT_US) . '"'.($current_page=='contact_us' ? ' class="infobold"' : '').'>' . BOX_INFORMATION_CONTACT . '</a>';   }

see the missing ' (in blue)

Regards

29 Jul 2014, 10:44 PM
#7
togfather avatar

togfather

New Zenner

Join Date:
Dec 2009
Location:
Scotland
Posts:
76
Plugin Contributions:
0

Re: Making current page display in bold letters

That's it David,

Thank you so much for your help. I have just added your Google Recaptcha plug in too, so that is a double thank you :-)

Best wishes

Tog

29 Jul 2014, 10:47 PM
#8
david_allen avatar

david_allen

Zen Follower

Join Date:
Feb 2008
Location:
Amersham, Buckinghamshire, United Kingdom
Posts:
141
Plugin Contributions:
1

Re: Making current page display in bold letters

Glad it works now

Regards