Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
page displays
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Mar 2011 at 08:56 UTC
Updated:
8 Nov 2011 at 19:40 UTC
Hello, i want to embed view block and i need theme output of view.
Way should be like this:
Conclusion of this way should be printing view output rendered with my theme file. But not. These two function (views_block_view, views_embed_view) use default theme files at "modules/contrib/views/theme/".
So only way how to theme embeded view outputs is modify original theme files at "modules/contrib/views/theme/".
btw Of course if you show block via region, everything is ok and outputs use own theme files.
I waiting for your feedback how to make these two functions use own theme files.
Comments
Comment #1
dawehnerYou should never input real php code into a page.tpl.php
Better use hook_preprocess_page and add a additional variable.
In general i have no idea why this happens here. views_embed_view just also calls the internal views functions as it is done when you have a block on normal way.
Perhaps move to preprocess can fix something here, but this is just a assumption
Comment #2
vogre commentedsubscribe
Comment #3
merlinofchaos commentedMy guess is that you have subtly named your template wrong. How you invoke the view has no effect on the template being used.
One thing to check is that _ are converted to dashes in templates, so if your view has the name my_view the template should be views-view--my-view.tpl.php
You also need to make sure it's in the right theme; when using administration themes, for example, you can have multiple active themes and this might confuse where it'll pick up the template.
Comment #4
dawehnerDid #3 helped you?
Comment #5
datawench commentedIt helped me. I was generating some output programmatically, using views calls, and this turned out to be exactly the issue I was having. I needed my view template overrides in the admin theme directory.
Comment #6
esmerel commentedComment #8
bfdzizu commenteddrupal is the best for a coaching site