-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Existing Content' block doesn't respect theme_hook_suggestions for template file names #2515
Comments
In my testing it does respect the view mode. But what it doesn't respect is the |
OK, i tested again - it does respect the view mode but still doesn't respect node template overrides in the theme folder. |
Further clarifications: still there in 1.6.1. |
I tested this feature on 2 sites and cannot reproduce. Backdrop 1.6.3 |
We have separate issue for "Show author and date information". #2536 Seems like view mode is respected by Existing content block, so I think this issue should be closed. |
Sorry, I think I didn't explain myself clearly in the beginning. View modes are respected, but if I try to use a template override (node--[contenttype].tpl.php in the theme folder) this override apparently isn't being used if inserted into the layout as an existing content block. To me inserting existing nodes with a template override was a convenient way to render sliders etc. on a layout section without the need of specialized display mode modules. It used to work in 1.5.x versions... |
At first I recommend you to upgrade Backdrop to latest version. It becomes better and better with each release :-) For me the best tool to debug theme suggestions is Devel module. Usualy I add @steponeloops let me know if you need more details about debugging with Devel. Or give me more information about your configuration and I try to reproduce it. |
I've tested again. I created node--page.tpl.php, added a page node to a layout. The view modes do work, and node--page.tpl.php can override a standalone node, but node--page.tpl.php is not outputting anything to the node embedded into the layout. I haven't tried this before so I can't attest to this being the right way to do it, but I can confirm it's not working now. |
I enabled theme debugging (can enable it in system.core.json) and it suggests node--block-##.tpl.php. So I tried that one too but no luck. |
@Al-Rozhkov: yes, I would like to upgrade but this one is a showstopper for me as already said I would like to be able to render overridden node templates in layouts so that I won't have to install additional modules if not necessary - a content type with multiple fields, load e.g. the js of slick carousel, make a node, insert it into the layout, slider done. The best thing in backdrop compared to Drupal to me is that with its layout system it is nearly complete even without additional modules - much easier to maintain :) Yes I am aware of devel and I use it occasionally - but thank you for your offering to help! |
Hello everyone, as this bug seems to be buried I would like to ask a few things: is my method of creating one page layouts (with different "existing content" blocks of different content types) that exotic? To me it seems the easiest way to render different sections such as sliders etc. since I can simply include external libraries such as slick carousel or full page.js - but those libraries of course need html output of a certain structure. And thus the need of "overridable" node templates also in the layout blocks (ie. "Existing Content" blocks). I know I could use views and views template overrides to achieve this, but for some simpler tasks such as a slider I would prefer this way: just one node with an unlimited image field, no additional modules needed, therefore way less update hassles. Am I missing some other way to achieve this in a simple manner since this use case seems not very common? :) It worked until the 1.7.0 update. Unfortunately I am not able to do more than testing and bug reporting - so someone else would have to look into this :( Is there a chance this bug could be addressed by someone? If I can help (w. further testing etc.) Someone let me know. |
I don't think so. I rarely use it too. And I can confirm this bug. As quick workaround you can create a view with contextual filter to show single node with particular view mode. It should use proper theme suggestions for nodes. I wish I can help as soon as possible, but I have very few free time right now. |
Thanks, Al-Rozhkov. I understand that this is a open source project where many people work in their spare time. I am using views right now! I am happy to hear this issue doesn't get buried tho. |
I'm experiencing this in Backdrop v1.12.6. Trying to override the output of an 'Existing content' block via a theme template ( Code is here: https://api.backdropcms.org/api/backdrop/core%21modules%21node%21node.block.inc/function/NodeBlock%3A%3AgetContent/1 |
@BWPanda does either |
@herbdool |
@BWPanda PR for testing backdrop/backdrop#2663 From looking at the code and the theme debug suggestions, only |
@herbdool Brilliant! That fixed the issue. Now I feel bad that I didn't even bother trying to find and fix it myself since it was so simple ;-) |
…lock. By @herbdool, @BWPanda, @steponeloops, and @Al-Rozhkov.
…lock. By @herbdool, @BWPanda, @steponeloops, and @Al-Rozhkov.
Wow nice one. Thanks @herbdool, @BWPanda, @steponeloops, and @Al-Rozhkov for working (and waiting) to fix this one together! Merged backdrop/backdrop#2663 into 1.x and 1.12.x. |
If I add a node to a layout via "Existing content Block" Backdrop pre 1.6.0 renders it in the selected view mode. 1.6.0 doesn't seem to respect the viewmode nor a customized node.tpl.php.If I add a node to a layout via "Existing content Block" Backdrop pre 1.6.0 used the custom node--nodetype.tpl.php template to render the block. 1.6.0 doesnt'do this anymore.
PR backdrop/backdrop#2663
The text was updated successfully, but these errors were encountered: