2

I want to display the breadcrumb and page title in my main content area.

For breadcrumb I used theme('breadcrumb', array('breadcrumb' => $breadcrumb));

What should I use for page title? I have tried theme('pagetitle', array('title' => $title_text)), but it is not working.

Also that how can I use the built in theme styles of paragraph tags or heading tags... e.g. I used the following for generating a table in built in theme style

theme('table', array('header' => $headers, 'rows' => $rows));
  • You don't need to use theme functions in your templates – Jaap Jansma Mar 10 '15 at 21:22
  • Thanx for your reply... You are right that we don't use the theme functions in our templates. Actually, I am making a module which doesn't have a template. In the module, I just want to display some data using my module which also modify the title of the page. And my theme display the title (sophistically) in a region named "pagetitle", I want to display the title in a different place on the page :) it's just a wish :) – Khurram Mar 11 '15 at 16:59
4

You're looking for the $title variable.

<?php print $title; ?>

Here is a list of all of the variables that are available to you in a theme file (for a page).

  • Thanx for your reply... "$title" actually returns the title text of the page... by the way, my theme is still not returning the title text when I use $title variable...:( Actually, there is a region defined in the theme "pagetitle" which displays the page title using some html and styles; I'm trying to get that region alongwith its title text and html styles using the method "theme(...)". I can get the breadcrumb alongwith html & styles with the method "theme(...)"... I hope you understand the question now. – Khurram Mar 11 '15 at 15:47
  • You can't magically call a theme function and hope it will do what you need it to do :) theme('pagetitle') is going to call theme_pagetitle() which I assume does exist. Take a look at hook_theme api.drupal.org/api/drupal/modules%21system%21system.api.php/… – Scott Joudry Mar 11 '15 at 17:09
  • Another example is that if I want to add a pager, i can use this code: theme('pager'); – Khurram Mar 11 '15 at 17:12
  • right, pager and breadcrumb are already defined in Drupal, pagetitle is not – Scott Joudry Mar 11 '15 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.