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.

#1757550: [Meta] Convert core theme functions to Twig templates

CommentFileSizeAuthor
#9 twig-field-ui-1898068-9.patch3.23 KBshanethehat
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

c4rl’s picture

Issue tags: +Twig

Tagging

duellj’s picture

Given #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.

c4rl’s picture

Let'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.

joelpittet’s picture

Status: Active » Postponed

Just 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.

star-szr’s picture

Status: Postponed » Active

Since #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!

swentel’s picture

Issue tags: +Field API

Tagging

star-szr’s picture

Issue tags: +Novice

Thanks @swentel, I should have brought that over. And I forgot to actually add the Novice tag.

shanethehat’s picture

Assigned: Unassigned » shanethehat
shanethehat’s picture

Status: Active » Needs review
FileSize
3.23 KB

I have a question about

function template_preprocess_field_ui_table(&$variables) {
  $elements = $variables['elements'];
  $table = array();
  $js_settings = array();

The $js_settings variable does not seem to be used, and Netbeans wants me to delete it!

shanethehat’s picture

Assigned: shanethehat » Unassigned

Status: Needs review » Needs work

The last submitted patch, twig-field-ui-1898068-9.patch, failed testing.

shanethehat’s picture

Assigned: Unassigned » shanethehat

Oops.

star-szr’s picture

Assigned: shanethehat » Unassigned
Status: Needs work » Closed (won't fix)
Issue tags: -Novice, -Field API

I'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.

c4rl’s picture

Title: Convert field_ui module to Twig » field_ui.module - Convert theme_ functions to Twig

Per #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.

c4rl’s picture

Issue summary: View changes

Add conversion summary table