I am displaying some links to add the nodes.
$links() = (
'url' => Url::fromRoute('node.add', ('node_type' => 'topic'), $options),
'title' => $this->t('Add topic'),
'attributes' => ('class' => ('button')),
'text' => 'abc',
);
$links() = (
'title' => $this->t('Add publication'),
'url' => Url::fromRoute('node.add', ('node_type' => 'publication'), $options),
'attributes' => ('class' => ('button', 'add-publication')),
);
return (
'#theme' => 'links',
'#links' => $links,
);
but it displays the content type names as link texts.
<ul>
<li><a href="http://drupal.stackexchange.com/node/add/topic">Topic</a></li>
<li><a href="http://drupal.stackexchange.com/node/add/publication">Publication</a></li>
</ul>
and I want to display the custom text instead of the content type name.
<ul>
<li><a href="http://drupal.stackexchange.com/node/add/topic">Add topic</a></li>
<li><a href="http://drupal.stackexchange.com/node/add/publication">Add ppublication</a></li>
</ul>
How can I do this?
Similar issue is with the #theme => item_list
also.