1

I´m trying to follow this steps:

https://www.drupal.org/node/2025313

This is my first day in drupal and I have a problem in the first step =(

This:

Identify the file your theme function came from (theme.inc? a core/modules/color/?)

How I can find this "theme function"? I was looking for into a files of the project but I cand find this....

I get this project from other person and I can´t ask him "ey, where is the theme function?" Maybe I have wrong concepts and I don´t know where search...

Can someone help me?

Someone knows what I search? Is a funtcion? Is a file?

1 Answer 1

1

So the page you're looking at shows how to convert a tpl.php to a html.twig. This is showing you how to update a Drupal 7 theme to be compatible with Drupal 8.

Assuming that is in fact what you're trying to do, you will normally find Drupal 7 theme templates at sites/all/themes/YOUR_THEME_NAME/templates. Once you navigate there, you should see files ending in tpl.php. Inside these files you might find a theme function being used. You can identify them as they'll look something like function theme_YOUR_THEME_NAME_hook($variables).

What is a theme function? A theme function is a PHP function that exists to provide HTML that is can be customized by themes and modules.

Here is the official list of theme functions. You can find a lot more information on Drupal.org, but here are a few starter links: 1. Theme API 2. Using the theme layer 3. Theme hooks

I would highly recommend reading a book on theming before tackling anything else. Drupal has a lot of depth, and if you're truly on day one and already converting themes, this will serve you well. I recommend 'Using Drupal' to understand the basics of Drupal, as a lot of Drupal development can be accomplished through the User Interface. Then move onto 'Drupal 7 Development by Example Beginner's Guide' to gain an understanding of how and when you should delve into actual code development.

2
  • Thanks Paul... the realy problem is that I don´t have time to read a book or something, I was looking for videos and reading about the conversion to html.twig. I just get a theme and I don´t know anything about drupal =(. Thanks a lot, this could be the begin to me =). Nov 18, 2015 at 8:45
  • No problem. I understand we often don't have time to read books on subjects; however, because Drupal is so complex I promise you'll make your time up in saved project time once you've read the two I mentioned. For a quicker fix on specific subjects, you can also subscribe to Drupalize.me and buildamodule.com for excellent training videos.
    – Paul
    Nov 18, 2015 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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