I want to format the editing or adding form for the article content type. i.e.
node/add/article path and editing the same article.
I copied over the
node-edit-form.html.twig template from
core/modules/node/template and renamed it
I also tried
node--article-edit-form.html.twig and some other flavors.
I can override the
node.html.twig file by simply copying it to my themes template folder.
But since I couldn't get the edit file to work I also tried overriding the form alter function by adding this in my theme file.
function newsass_form_node_form_alter(&$form, FormStateInterface
$form['#theme'] = ['node_edit_form'];
This code is from here- How to override node add template for custom content type?
I added some text on top of the code, but I still can't get the article 'edit' or article 'add' page to display the text.
Drupal 8.6.1, and have debugging enabled. Full explanation of requirement: I have a user entity reference field in the article content type with a list of users that the article can be assigned to. For the most part they have an 'article' role. But if the person leaves, their role will be changed to 'Away'. The article can/will still be assigned to them but I need to indicate that they are no longer with the company or 'Away'.
Within views entity reference I am able to re-write the user with the users role but this information doesn't get back to the entity reference field in the editing node.
I thought of editing the article node and adding a hook to call the assigned users role..... Which I still need to figure out how to do.
With debugging I tried suggested template
page--node--add--article.html.twig but I still couldn't get the content revealed and yes I cleared cache. Using page level though doesn't allow granularity for each field.
QUESTION: By mytype is that the machine name of the entity reference field in the content type? I am also not quite understanding this function, where is the call to query the roles? I enabled kint and added this to the function.
but get nothing returned. How do I check if this function is actually being called.
I tried something else also. I have users in the entity reference and in the entity reference views for users I added the roles, made them hidden and rewrote the users to include the roles. I works nicely in the views preview, but the roles detail doesn't get carried back to the content type add/edit pages.