1

this is one of the most confusing tasks I've been asked to accomplish in Drupal. I have a Content Type called Latest News that has a Date field (not the creation date, a date that represent's the new itself and may be used for the filtering process).

What I need is the following page:

_________________________
|  _____  ____________  |
|  |   |  |          |  |
|  | A |  |    B     |  |
|  |   |  |          |  |
|  |___|  |          |  |
|         |          |  |
|  | C |  |__________|  |
|                       | 
|_______________________|

Where A is a list of Latest News nodes' titles, B is the node itself (smells like Panels), and C is a menu that contains dates spanning from 2004 to now (dynamic preferably), that acts as a filter to view A.

Whenever a user clicks on a date on C, the titles in A are filtered (much like an exposed filter), and the node display on B should change to the topmost item of the currently filtered list on A.

The current displaying node's title should be highlighted.

If the user has filtered A to display news from 2011, clicking on one of them should retain the filter, and simply display that node.

How would you go about doing this? I will be editing this question if more clarification is needed. Thanks in advance.

2
  • It would be helpful if you could tell us what you have done so far and where you are getting confused, so that we know how to answer the question better.
    – Ashlar
    Mar 16 '12 at 15:49
  • let's just say I haven't started it yet. I have it partly progressed but I think it can't be completed in that direction, so if you have a clear scenario planned I'd love to listen to it.
    – user5005
    Mar 19 '12 at 7:12
1

Here's what I would do.

First I'd enable the CTools Page Manager and Views content panes and create a page (admin/structure/pages) for that display that has arguments in it's path.

Then I'd create three views with display type "content pane": one that lists nodes based on a contextual filter (A), one that shows only one node (B) and one that lists dates (C).

Then I'd create the column layout in the page's content and would provide the arguments with Page Manager.

Here's a really nice tutorial from NodeOne that addresses most of the tricky parts here: http://dev.nodeone.se/en/learn-page-manager-part-5-views-content-panes-basics

6
  • I'll give it a shot and I'll come back to you.
    – user5005
    Mar 19 '12 at 7:12
  • 2
    Looks good, upvoted. But why three content panes? Re-working it to use the actual "Node content" would be better IMO. Starting a View for rendering data that is already availble seems silly, and not actually rendering a node on a node page causes Core not to execute certain node related hooks which can confuse people a lot. (Though, in this case Views would probably do that part for you anyway)
    – Letharion
    Mar 19 '12 at 7:32
  • I am still looking at those screencasts to get a clearer image of what's going on so I don't sound (too) silly, but from what I've read already, how would the currently selected date / node title combo stay selected(active) in a menu->submenu-like fashion? I mean I can add the views and the filters but that part is still puzzling me.
    – user5005
    Mar 19 '12 at 9:12
  • I mean, if the user clicks on 2010, the "2010" link should stay active and the first "node title" link should be selected with that node's content displaying in [B]. If then the user clicks on the second "node title" link, that should become selected, with "2010" still remaining selected and that node's content being displayed on [B]. If the user clicks then on 2009, rinse and repeat. I think you get the idea :)
    – user5005
    Mar 19 '12 at 9:18
  • @Letharion is right, my answer was a bit lazy in the sense that it's totally possible and even preferrable to override the main node view with this and thus avoid having to use a view to grab the node. You could also use the "existing node" content in Page Manager. Mar 20 '12 at 20:54
1

Thanks to Tommi Forsstrom's answer I got lead in the right direction:

I created a panel with A,B and C being 3 regions in it.

In A I used 2 view panes, one that showed the latest 15 news and none that showed all the news according to one of the panel's arguments. If the argument was a prefixed value ("all" for example) I'd show the first view, if not, I'd show the second one that would get filtered by the argument (if it's not "all" it's a year (2012 for example) and it's valid for filtering).

In B I used 2 view panes that displayed full content, with the only difference that one of them had an extra contextual filter (the date). Both of them had the NID of course.

On C I have a static menu (will need updating on 2013 sadly) that leads to the panel/year url. So that covers the date filtering as well (and leads me to the second view).

As far as the "stuff staying selected" I had to write some correctional javascript to do that. On document.load I check the url and add "active" classes to whatever should be active.

At the moment this is the best I could do. If anyone has a better solution I'll gladly pass the green checkmark along :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy