1

I have a content type named "film" and a form mode named "film_artistic"

in my_module.routing.yml, I have added this entry:

my_module.film.artistic:
  path: 'node/{node}/artistic/edit'
  defauts:
    _entity_form: node.film_artistic
    _title: 'Edit artistic info'
  requirements:
    _permission: 'access content'

But when I try to reach, let say "/node/6/artistic/edit" I got a "Page not found" result

I don't know what I am missing...

My ultimate goal is to have several form mode for my film content type (ex: Artistic, Technical,...) and for each of them, I would like to create a "Local Task" sharing the same base_route: "entity.node.edit_form". For my first local task, I have to add the following in my_module.links.task.yml:

film.artist:
  route_name: my_module.film.artistic
  title: Edit artistic info 
  base_route: entity.node.edit_form
  weight: 20

But of course I can't test it as my main route is not working (node/{node}/artistic/edit)

0

I could find a solution with an handy module: https://www.drupal.org/project/form_mode_control

After installation, you can reach any form by using :

 www.your-site.com/node/add/my_content_type?display=machine_name_of_your_form

or

www.your-site.com/node/{node}/edit?display=machine_name_of_your_form

More then this, this module allow you to set permission to access each form mode.

I am still looking for how to add those forms as local task... but the main thing is done

My objective is: if I go to node/add, or node/{node}/edit, I would like to have the default form displayed but also, all the form mode accessible as Tabs (local task)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.