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.
Task
Use Twig instead of PHPTemplate
Twig sandbox: http://drupal.org/sandbox/pixelmord/1750250
Remaining
* replace all tpl.php files with .html.twig equivalents
* replace all theme functions with .html.twig equivalent templates
* add new preprocess functions for the .html.twig equivalent templates
* update all hook_theme definitions
We should add 'file' => 'field_ui.admin.inc' to the hook_theme() definition:
/**
* Implements hook_theme().
*/
function field_ui_theme() {
return array(
'field_ui_table' => array(
'render element' => 'elements',
'file' => 'field_ui.admin.inc',
'template' => 'field-ui-table',
),
);
}
Theme function name/template path | Conversion status |
---|---|
theme_field_ui_table | Needs to be brought over from the sandbox. |
Related
#1757550: [Meta] Convert core theme functions to Twig templates
Comment | File | Size | Author |
---|---|---|---|
#9 | twig-field-ui-1898068-9.patch | 3.23 KB | shanethehat |
Comments
Comment #1
c4rl CreditAttribution: c4rl commentedTagging
Comment #2
duellj CreditAttribution: duellj commentedGiven #1876712: [meta] Convert all tables in core to new #type 'table', this issue should be closed, since there's no other theme functions in field_ui outside of the table theme.
Comment #3
c4rl CreditAttribution: c4rl commentedLet's wait until #1876712: [meta] Convert all tables in core to new #type 'table' is marked fixed before deciding whether we should close this one.
Comment #4
joelpittetJust an update: here is the issue for this conversion.
#1938900: Convert theme_field_ui_table into a template
I had a look at that conversion and it looks quite involved, they have their own pre_render that may not gel with #type=>table's prerender and it's being used in a few spots.
Marking as postponed to see if we can push a bit more help getting those #type=>table conversions out of the way.
Comment #5
star-szrSince #1938900: Convert theme_field_ui_table into a template is not a form table, I think we need to do a Twig conversion for now.
Tagging as a Novice task to bring over this conversion from the sandbox.
I recommend taking a look at @c4rl's screencast: http://www.youtube.com/watch?v=HS4yKJjrb2E
If you'd like to work on this, please assign the issue to yourself. If you get stuck, drop by #drupal-twig on IRC or post your questions here. Thanks!
Comment #6
swentel CreditAttribution: swentel commentedTagging
Comment #7
star-szrThanks @swentel, I should have brought that over. And I forgot to actually add the Novice tag.
Comment #8
shanethehat CreditAttribution: shanethehat commentedComment #9
shanethehat CreditAttribution: shanethehat commentedI have a question about
The $js_settings variable does not seem to be used, and Netbeans wants me to delete it!
Comment #10
shanethehat CreditAttribution: shanethehat commentedComment #12
shanethehat CreditAttribution: shanethehat commentedOops.
Comment #13
star-szrI'm terribly sorry @shanethehat, I should have confirmed this first but I spoke with @duellj and it sounds like this would work better as a #type table conversion after all. Hope it was good practice for you at least.
Comment #14
c4rl CreditAttribution: c4rl commentedPer #1757550-44: [Meta] Convert core theme functions to Twig templates, retitling to indicate this issue applies to theme_ functions, which are lower in priority than PHPTemplate conversion issues.
Comment #14.0
c4rl CreditAttribution: c4rl commentedAdd conversion summary table