Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
By jasonzh on
function bartik_process_page(&$variables) {
$variables['theme_hook_suggestions'][] = 'page__product';
.....
}
above, I can suggestion page--product.tpl.php
but it is static.
if product is a content type name, then how to suggestion it dynamatic?
I can not get the node type in function bartik_process_page(&$variables) .
Comments
theme_hook_suggestions
Hi,
There is an example here:
https://drupal.org/comment/6811332#comment-6811332
You do not need to add
You do not need to add template suggestions for content types, system already provides them. So if you have a content type named product, you can implement page--product.tpl.php and if you have a content type name ninja you can implement page--ninja.tpl.php without having to implement any template suggestions.
thanks, arrakis83
thanks, arrakis83
hi,Jaypan , from https://drupal.org/node/1089656 ,in drupal 7 , node--type.tpl.php is ok,but page--type.tpl.php not support
drupal ,the sharp skill to eastablish website.
This will work :
This will work :
Rajeev Kumar,
@drupler@bihar.social (ActivityPub)
Great ,thanks!
Great ,thanks!
drupal ,the sharp skill to eastablish website.