Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By nick_helps on
Hello,
I have a node--blog.tpl.php which works fine.
I also have a block that has a view which lists 5 blog items. This view uses tpl files.
Now if I try to add this view in the blog page under the main content area, then node--blog.tpl.php also starts using the tpl of the view (i.e. shows the blog title only) instead of following the node--blog.tpl.php and showing the title and content.
Am I doing something wrong or is this drupal's limitation?
Comments
Anyone?
Anyone?
I'm not sure you're
I'm not sure you're describing what you doing accurately.
All views use tpl template files, but the question is - which ones? A simple to check is to look if your View is using fields, or is it teasers? If it's teasers, then it's going to use the same node--blog template as the full node view, which may or may not have some code in there to control what shows in teaser view mode verses full view mode.
Look at the theming information for the View and see which templates are currently being used, they should be the ones in bold.
Also depends on what this means, i.e. precisely what are you doing here:
When asking for help you actually need to be very, very precise with questions giving all steps in precise detail because there are many many ways to build and configure Drupal sites, we can't guess what this might actually mean (could mean a lot of things).
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Thanks for your Reply Jeff,
Thanks for your Reply Jeff,
I will try to explain the whole scenario.
I have a view called "Latest Blogs" that shows the titles of 5 latest blog entries. It uses "Format: Unformatted list" and "Show:Content | Teaser". I have a node--view--blog--block-1.tpl.php that is used to template this view. My theme has a region named "Below-Content" right below the region 'Content'. I added this view in the Below-Content region, and it shows latest 5 blog titles as it should.
To display the content of a blog entry I created node--blog.tpl.php which works and shows the title and the content of the node on its page (/node/XYZ) as desired as long above mentioned view is not added to Below-Content. So they both work stand alone without any problem.
Now as soon I add the view in Below-Content region and view a blog post I notice that blog's body disappears and shows the title of the blog only as if it's following the tpl of node--view--blog--block-1.tpl.php instead of node--blog.tpl.php.
Does this make sense?
Does this make sense?
The description makes sense, but the outcomes does not. Personally I have not seen anything like this ever before and it is highly unusual, I'm sure theres more too this, it would seem rather impossible to me that a Views block would interfere with an entity view (the blog node).
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Okay, This issue was only on
Okay, This issue was only on the pages which were on the latest five list, so excluding the current node from the list view helped resolved the issue from being visible at least.
Thanks for your replies Jeff. They kept me going and solve this issue.