1
votes

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

1 Answers

1
votes

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.