Highlighting links to current page?

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
11/17/2008 12:25:26 PM
Gravatar
Total Posts 88

Highlighting links to current page?

Hello,

I am wondering if something is possible using mojoportal, whether the code has already been built.

I have a page called "FAQ" with about 20 questions on it. The desired functionality is that when the user clicks on one of the questions, the full list of questions continues to be displayed on screen. The question that was clicked will become highlighted. Underneath the list, the answer will be displayed.

I reckon it makes sense to write the list of all questions in an HTML module (let's call it "FAQ List"). Then create a new page for each question's answer. On each page, the "FAQ List" content would be published, along with a unique  HTML module content containing the question's answer.

However, what I don't know is - is it possible to have the link to the current active page , highlighted in some way? Bear in mind the links are contained in the module that is published on each page.

I've figured out one way to do it without server side programming would be to add an id to the body element on each page, e.g. <body id="bfaq1">. Each link would have its own id too (e.g. <a href="faq1" id="linkfaq1" />Question 1</a>). Then in the CSS file, I would specify a style #bfaq1 a#linkfaq1 {font-weight: bold;}. If each question is assigned an individual id, and each page could be assigned an id corresponding to the question it answers, each page would show the link to the current page highlighted.

However, I don't know of any way I can edit the body element... and its possible some code already exists for something like this...

grateful for any comments,

thks

Leah

11/17/2008 1:10:04 PM
Gravatar
Total Posts 18439

Re: Highlighting links to current page?

Hi Leah,

I'm not sure this will really give you the effect you're looking for but what I would do is:

Create a page name FAQ and put no content on it but in page settings enable show child page index.

Beneath that page I would create a page for each answer making the title of the answer page equal to the Question. I suppose if the questions are very long it may be a problem.

I would enable show bread crumbs on each of the child answer pages.

Hope it helps,

Joe

 

11/18/2008 1:02:29 AM
Gravatar
Total Posts 88

Re: Highlighting links to current page?

This is helpful, thanks. It's different to what I was originally looking for but could possibly work.

However I noticed that if the child pages are to show in the child page site map, the child page needs to have "Include in Menu?" set to Yes. Would it be possible to separate the two and have a new property, "Include in Site Map?" In this example, I'd like to include the pages in the site map but exclude them from the menu.

Also I take from your answer that it isn't possible to add attributes to the body element without going in to the code.. is this correct?

thanks Joe,

Leah

 

11/18/2008 6:36:08 AM
Gravatar
Total Posts 18439

Re: Highlighting links to current page?

The only place you can affect the body tag directly is in the layout.master file but any changes there would be on all pages. You could possibly add a css class to body from within your html module using javascript. We include jQuery in the page so learning to use that might be the easiest way. I would uses class names not ids.

Hope it helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.