I've got a page template that has four divs that contain this node's content - with a small menu in the template that uses jquery to hide/show the relevant divs.

In the Drupal main-nav, I've got a link with four dropdowns, each intended to go to this node and show the specific div (if it's possible. Something like going to a link with an anchor: www.website.com/page.php#anchor. I'm trying to determine a way that I can do this with these hidden divs. If the user clicks on "option a" in main nav, it goes to this node and shows the div "option a", hiding the others.

Maybe this is a jquery thing. maybe there's some slick way in Drupal? But I'm not sure how to pass the info of what link? Or if there's a simpler way? I'm trying to avoid having to make 4 different pages in this situation.

Comments

nevets’s picture

Not sure why you are trying to avoid 4 separate pages since you only want to show one section at a time. It seems like you are making extra work for yourself.

turpentyne’s picture

Yeah. I thought that I'd get that answer. but in this case, I still need to do it this way. For numerous reasons not necessary to the question, I've not yet found a better way to do this portion of the website.

nevets’s picture

A possibility Single Page Site.

For more possibilities search for anchor under the modules download page.

turpentyne’s picture

The Single Page site module is a possibility, but I need to exhaust all options before resorting to modules.

I'm rethinking things though. I'm wondering if I can get an idea of how to load asynchronously when clicking on a second menu, that sits on the template page - simply replacing the content in a specific div of the node template with another page?

turpentyne’s picture

On a lark I tried the Single Page Module to solve this. Not only did nothing load on the page, it's not what I want, this seems to be creating a scroll-to-anchor point solution - not what I'm wanting.

Then I finally found a tutorial that walked through exactly what I needed, here: http://www.seanbuscay.com/ajax-reader-demo/

Apparently Drupal 7 has some Ajax stuff baked in, and his solution worked like a charm!