Page list highlight

Permalink 3 users found helpful
Hi all

I was wondering if there is a way to do this.

With Auto Nav, when you click on a page it will highlight the button to let you know that you are on that page. Page list does not do this and was wondering if there is an easy way to do it?

Or has anyone else created a solution?

Hope someone can help.

Cheers

Chris

senshidigital
 
red replied on at Permalink Reply
red
***After viewing your profile maybe my answer is not to what your asking,some of your work already does what I inturpet your question to be*******


Can be done via the stylesheet with something like this:

#menu li a.current, #menu li a.nav-selected {
color: #DBC48E;
}

you could use an image,background color or text color as I do.

Im sure there are other ways to get the same result,but this could be one.
senshidigital replied on at Permalink Reply
senshidigital
Thanks red

Yeah I know how to implement it through CSS no problem. With the Auto Nav add-on it automatically adds a class to the link when you are on that page (using php code etc). The Page list add-on does not.

If I add a class to the page list it will add the class to all links.
red replied on at Permalink Reply
red
Which add-on is that exactly, I looked for it but could not find in add-on.
senshidigital replied on at Permalink Reply
senshidigital
Page list. It comes with C5.

Sorry should say Block not add-on.
cannonf700 replied on at Permalink Reply
cannonf700
Could you make a custom template for a page list? After creating the page list then you could choose to apply the custom template to it.
This is easily done with auto_nav so it seems like it work for the page list as well.
senshidigital replied on at Permalink Reply
senshidigital
If I change the template that will change all the buttons will it not? Plus that will not go down with my client as they would not have a clue how to do this if they added pages. A lot of people will be updating the site within the company.

All I need is the same functionality as the Auto Nav block, with its auto highlight of the button when on the page, applied to the page list block.

Looking at the PHP of the page list block, it does not have the code to apply the auto highlight. Its built in a different way.
rickychapman replied on at Permalink Reply
rickychapman
I'm trying to do the same thing here:

McKinleyArchitects.com

I'm using a variant of the page list block to display a number of portfolios with a line of description below them, and I'd love to be able to have the link for the current page highlight when you're on the page.

Has anyone gotten any further on a solution for this?

Thanks!

Ricky
Shotster replied on at Permalink Reply 1 Attachment
Shotster
Attached is a modified version of the default page_list view. It adds a class called "active-page" to the <h3> element containing the page title.

To use, just drop the contents of the attached archive into the root blocks folder. Then, with the page containing your page_list block in edit mode, click the block, choose "Custom Template" and then select "Show Active Page" from the pop-up menu. Save and style as desired using CSS.

Basically, it just compares the collection ID of the page list item to that of the current page. If they're the same, it adds a class to the <h3> element.

Hope it helps,

-Steve
rickychapman replied on at Permalink Reply
rickychapman
Steve -

I'll check it out - I'm already using the Thumbview custom template to create roll-over thumbnails, but I'm thinking I'll be able to combine what I need to from both custom templates to make it work. I'll let you know how it pans out.

Thanks!
Shotster replied on at Permalink Best Answer Reply
Shotster
Here's the juicy bit in a nutshell...

// Get current page
$pg = Page::getCurrentPage();
$pgID = $pg->getCollectionID();
// In the loop, compare collection ID's
if ($cobj->getCollectionID() == $pgID) {
   // This page list item is the current page.
}

-Steve
jonghdesign replied on at Permalink Reply
jonghdesign
Great feature!