Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
Jon PughPatch with this template and CSS changes is in #1987406: node.module - Convert theme_ functions to Twig...
Should we mark this as duplicate?
Comment #2
Jon PughMarking as duplicate after speaking with Jen!
Comment #3
jenlamptonClarifying issue title so it's clear that we need to delete this function from the seven theme :)
Comment #4
jenlamptonI 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
Comment #5
star-szrRe-closing then :) Thanks Jen and Jon!