Question

For a Drupal site I'm building, I've used the Views module to create a custom view that shows the top 10 most popular taxonomy terms. I'd like this list to show up in my site's header but I'm having trouble accomplishing this. I can get the header to display a link to the page for the view, but haven't figured out how to actually display the content of the view in the header node.

Also, if there's a better way of accomplishing what I'm trying to do, I'm all ears!

Was it helpful?

Solution

You should create view with the "block" display. This block can be placed in any region using standard block/theme functionality. If you don't have "header" region, you can create your own. See this link for details. https://drupal.org/node/1088718

Maybe, i do not quite understand you question (actually, phrase "header node" confused me, you mean header area/region?). If you need to display view on the node page, you can use views_attach ot eva modules.

OTHER TIPS

Option 1: Create a region in your theme. Render the region on your theme page.tpl.php Create a block display of you view and assign it to that region.

Option 2 You can create a view and then embed it in your theme file using views_embed_views. For details https://api.drupal.org/api/views/views.module/function/views_embed_view/7

Hope this solves your problem

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top