While converting to Twig, we found little reason to keep the definition list syntax used in core's theme_node_add_lis() function. We move that instead of overriding this output in the seven theme, we should update the original markup with the new and improved version, thus removing the need for the theme override.

Here is our sample "improved" markup for core (core/modules/node/templates/node-add-list.html.twig)

{% if content %}
  <ul class="admin-list">
    {% for type in types %}
      <li>
        <span class="content-type-{{ type.type }} label">{{ type.add_link }}</a></span>
        <div class="description">{{ type.description }}</div>
      </li>
    {% endfor %}
  </ul> 
{% else %}
  <p>{{ no_content_text }}</p>
{% endif %}

Comments

Jon Pugh’s picture

Patch with this template and CSS changes is in #1987406: node.module - Convert theme_ functions to Twig...

Should we mark this as duplicate?

Jon Pugh’s picture

Status: Active » Closed (duplicate)

Marking as duplicate after speaking with Jen!

jenlampton’s picture

Status: Closed (duplicate) » Active

Clarifying issue title so it's clear that we need to delete this function from the seven theme :)

jenlampton’s picture

Title: remove seven_node_add_list() - update theme_node_add_list() instead. » remove seven_node_add_list() from core (update the markup in theme_node_add_list() instead)

I just re-read the patch, and that other issue does in fact remove the seven theme's node_add_list function. So, nevermind! Putting things back the way they were :)

This is a dupe of #1987406: node.module - Convert theme_ functions to Twig

Cottser’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)

Re-closing then :) Thanks Jen and Jon!