LittleBoy template: adding "Skip to content"

6 years 4 months ago #806 by perini-ps
Hi Holger + co,

BIG fan of Pixelsparadise! Now onto our second PP template with a client, and this time we're using Littleboy.

I've been asked the following:

"Can we have a ‘skip to page content’ link above the unordered navigation menu list, visible when styles are disabled?"

... good question!

I can, of course, add that function as a module but that might not work with all pages.

Can I do this in the template code? Where would I put it?

Thanks very much,
Paul

Please Log in to join the conversation.

6 years 4 months ago #807 by Adminv
Hi!

Sure, you can hardcode it into the templates index.php.
A linke like
<a href="#maincontent" class="skip_to_content">Skip to maincontent</a>

near the main menu module position and than add a anchor id to the main content sourrounding wrapper element.

By default it looks like:
<div class="sourrounding_wrapper main_area_wrapper">

change it to:
<div class="sourrounding_wrapper main_area_wrapper" id="maincontent">

Than you can add additionally this CSS class to the templates style.css file:
a.skip_to_content {display:none;}
Than the link is invisible but will appear if all styles are disabled.

That will work too.
BUT: If you hardcode it right into the template it will be there on any single page. Add the anchor id to an element inside a module or article and place the link code in a separate module gives you much more flexibility You can disable or enable it on certain pages without touching the source code.

Please Log in to join the conversation.

6 years 3 months ago #819 by perini-ps
Replied by perini-ps on topic LittleBoy template: adding "Skip to content"
That's wonderful. Thanks as always Holger! B)

Please Log in to join the conversation.

Time to create page: 0.161 seconds
Powered by Kunena Forum
Don't have an account yet? Register Now!

Sign in to your account