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.
I am using the latest version. I tried to dsm the $title variable in page.tpl.php but it is empty in taxonomy term page and in the product display page
Does anyone else facing this problem??
Thanks
Comments
Comment #1
jajouka CreditAttribution: jajouka commentedyes, I am having the same issue regardless of which theme I use but the problem is in the node.tpl.php page.
Comment #2
odizle CreditAttribution: odizle commentedHi, did you manage to get this working? I am having the same issue, Views pages dose not show the title no matter what theme.
Comment #3
dianikol CreditAttribution: dianikol commentedThey way i did it is in template.php using preprocess hook and drupal_get_title() to save in a $title variable the current title
Comment #4
jsacksick CreditAttribution: jsacksick commentedWe're overriding it in multiple places, I'm not sure what to do with that issue, we've decided to hide the title in some of the pages. We probably should add a Kickstart settings form somewhere and hide these kinds of overrides.
Comment #5
dianikol CreditAttribution: dianikol commentedI think in the template.php and using drupal_get_title() you'll get the last override before print it. Is is what you need? I mean the end result of the title. Maybe an extra field will do the job!
Comment #6
dianikol CreditAttribution: dianikol commentedComment #7
lsolesen CreditAttribution: lsolesen commentedSeems that @jsacksick answers the question. Please reopen if you disagree.
Comment #8
sagacity CreditAttribution: sagacity commentedFor me it was still not working, even with configuration (Commerce Kickstart 7.x-2.22). For me this helped (in template.php or as own module):
Comment #9
armyofda12mnkeys CreditAttribution: armyofda12mnkeys commentedAbove didnt work for me... I'm having a related issue with a pretty recent build: 7.x-2.39
I dont see the title for Blog Posts under Commerce Kickstart.
Blog Post content type uses title_field machine_name (i guess this might be from Title module making titles translatable)...
To show this, under the file commerce_kickstart_blog.info, i see the title field defined like so:
features_exclude[field_base][title_field] = title_field
but in the commerce-kickstart blog template 'node-blog_post.tpl.php', it uses $title which is always blank.
I guess I could replace $title with $title_field['und'][0]['safe_value'] in the template but that feels wrong to me (a deep field in an 'und' array).
I'm assume maybe $title should be overriden by Drupal Commerce to pull the translated $title_field?
EDIT: For now, i'm manually putting $title = $node->title; in my blog template (which although cleaner than $title = $title_field['und'][0]['safe_value'];, also feels wrong). Whats the solution?