Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm working on a Drupal site an need to implement the following:

I have created an about us page template (page--about.tpl.php) and a custom content type for the about us page and linked the 2 using suggestions. I also have a custom content type for staff profiles that I need to add on the about us page in a tabbed format.

I can't seem to find a way to get the staff content to display in the about us page. I would ideally like it to render it the same manner as blog posts would display in a blog page.

So my question is, what code do I use to render all the nodes of the staff profiles content type in the about template page?

p.s I'm a bit of a Drupal noob, done a lot of reading but come up empty on this one.

share|improve this question

2 Answers

If you already created content type About us (that is what i understood from mockup and explanation) then maybe you could use Views with EVA. That will enable you to have view as field in content type.

You can set it up with manage display or print it in template as all other fields. For example:

<?php print render($content['your_view_entity_view_1']); ?>

Other way would be to embed view in template. For example:

<?php print views_embed_view('your_view', 'block'); ?>
share|improve this answer
 
I've got it partly working using Views view_embed_view(); however I need to use a custom field template to generate the tab buttons and I can't seem to find a way to get the view I've created for the buttons to use my custom field template (views-view-field--field_myfield.tpl.php). I would appreciate any help you could offer. –  Grant Colloty Jul 3 at 1:30

You can use the excellent Views module to create a block to list all your staffs.

Then you need to place the block that you had created with the help of view module in about-us page.

The Views module will give you suggestions to about which template to use.

EDIT: After the op provided the following image. enter image description here

After you create a view to show all the Team member nodes you could simply print the view in your about us specific page template using following code.

$view = views_get_view('view name');
print $view->render('display_id');

Another option to do the same thing is, make blocks for all the content, viz. The Firm, The Team, Awards, Technonogly, Services and use quicktabs to display the content.

Yet another option to show a view as a field for a node is use EVA

Going the quicktabs way you can provide a lot of flexibility of showing teaser in about us page and leading to details about the same. For example each award can be a node in itself.

share|improve this answer
 
Going to give that a try. Thank you! Is there any way I could hard code it into the page template, I would prefer to be able to upload the template files and have a ready-to-go solution. –  Grant Colloty Jun 13 at 12:43
 
Oh dear, please do not do that. Template files should be used for theming purpose only please. Views module provides a GUI to create the query you would do otherwise using php coding. It interfaces with lots of 'view-modes' like tabular, tabular-grid, html lists etc. You have more than decent control over how the content is presented. But it still offers you a decent template guide. –  D34dman Jun 13 at 20:08
 
I've tried with Views and it's a no go, the page uses tabs with nested tabs and there is no efficient way to get the content in with out having to create a new block for each new node of a content type. Surely if the template file is used to display content there can't be an issue 'forcing' it to display a particular type of content. A Blog Page shows content of the node(content) type 'blog', why can't I set my About Us page up to show content of the node(content) type 'staff' in a particular place in the code show along with the fields from the about us page? –  Grant Colloty Jun 18 at 9:27
 
can you show me an html mockup, i must confess i am not able to comprehend your requirement. At the least a sketch if possible. –  D34dman Jun 18 at 20:13
 
Hi, here is the basic set up sinaicom.com/kfpa/about_us_graph.jpg for the page –  Grant Colloty Jun 19 at 8:50
show 2 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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