1

I'm trying to create a single content type that displays data across multiple pages for a client. For example:

DOG content type with fields:

  • List item
  • Name (Title)
  • Breed
  • History (Body)
  • Age
  • Weight
  • Height
  • Previous Owner Name
  • Previous Owner State
  • Previous Owner Gender

and then I would I like these pages created automatically:

/dog/<name> (overview page that includes Name, Breed, History)
/dog/<name>/details (includes age, weight, height)
/dog/<name>/owner (includes previous owner name, state, gender)

Each page would have a submenu that links to the other pages. I can create the first overview page no problem, but how would I create the the second and third pages? Would I look at the URL pattern to find content matching the name?

2

As fas as i understand the question your requirement is to display those content on different pages. So it is better to create a three different views displaying the required data.For example you can create first view name dog1 having field name , breed and history and a second view name dog2 having field age weight and height and so on. And also you add submenu of those two pages link.

  • I've only ever used Views to display content listings, so this is a fantastic idea. As I asked xurshid29, any advice for building out the contextual filter? – woodsman Apr 3 '13 at 1:37
  • this may help you http://drupal.stackexchange.com/a/51426/14555 – nit3ch Apr 3 '13 at 5:27
1

According to me one should create 3 different views and according to the requirement one can select the fields. Like let the first view be dog1 having fields Name, Breed, History. second view be dog2 having fields age, weight, height. third view be dog3 having fields previous owner name, state, gender.

1

you can create thre diffrent views for your three pagess and regarding the display of views and sub menu on a common page u can go for node pages structure just design a page and add varient to it ..!! hope this would be helpful

0

you can create views with contexual filters and create menu path like dog/%/details(or owner), pass argument from cont.filter or, second method, read about hook_menu and _to_arg() function..

  • Any advice for building the contextual filter? I've tried using the NID with "Raw value from URL" and "Use Path Alias". If I type in the NID in the Preview panel it shows up, but if I type in the final section of my aliased path it does not. – woodsman Apr 3 '13 at 1:34
  • ok, i'll give you a quick example for dog/<name>/details: 1. Create page view, add menu link like dog/%/details; 2. Add desired fields (age, weight, height); 3. Add one contexual filter based on name field, and configure filter like this: Provide default value: Raw value from URl, Path component - 2, check Use path alias; This is main configs, otionally you can check Override title and create your own title – xurshid29 Apr 3 '13 at 11:29
  • After that you will need to create menu links like dog/<nameOfDog>/details. The easiest way is to create with Views,. Just create block with views and from Rewrite results container check Output this field as a link, then build url like this dog/[TOKEN FOR NAME FIELD]/details. If you do not see your name field token then add that field and move it top and set Exclude from display; – xurshid29 Apr 3 '13 at 11:37
0

Personally, I would prefer to solve this with tabs. JavaScript-based tabs are better for SEO because the entire node can be indexed at once. I also think that views adds unnecessary overhead if you use it to display only one node. See https://stackoverflow.com/questions/8550534/how-to-display-node-fields-in-tabs for instructions.

  • Each of the tabs I'm building are pretty media intensive, so I'd just be worried about download size/time? – woodsman Apr 3 '13 at 1:25
  • That's a legitimate concern. You could consider using a javascript lazy loader such as drupal.org/project/lazyloader, which only loads the image when needed. However I do not know how it combines with tabs, you would have to try that out. – marcvangend Apr 4 '13 at 10:33
0

Try Node Embed it's used by www.whitehouse.gov and is cited

Node Embed provides an input filter for CKEditor & FCKEditor integration allowing a content editor the ability to embed the rendering of nodes within the body/fields of another node.

Im not much of a programer but this seems to be a nice simple solution.

Best of luck!

  • This isn't exactly what I'm looking for, but it looks very helpful for other future projects. Thanks! – woodsman Apr 3 '13 at 1:24
0

Also consider using Ctools Page Manager + Display Suite. It's possible to build exactly what you have asked for using these 2 modules in combination: Page Manager to create the tabs and Display Suite to define the content display for each one. There's quite a lot to learn when using these modules but once you have become familiar with them you'll find there's tremendous flexibility available to you.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.