I've created a route:

regions.taxonomy_term.edit_form_header:
  path: '/taxonomy/term/{taxonomy_term}/edit'
  defaults:
    _entity_form: 'taxonomy_term.default'
    _title: 'Edit term'
  options:
    _admin_route: TRUE
  requirements:
    _entity_access: 'taxonomy_term.update'
    taxonomy_term: \d+

But now I can't add to path anchor attribute.

For example:

path: '/taxonomy/term/{taxonomy_term}/edit#header'
New contributor
WiseUA is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • Why does it need to be defined in the route? – Kevin Dec 4 at 16:40
  • @Kevin Because it's route for contextual links, and I have two routes for one page with "field_group" tabs. – WiseUA Dec 4 at 16:44

Thanks everyone!

I have solution my for problem. You just had to add it to this my_module.links.contextual.yml file.

regions.taxonomy_term.edit_form_header:
  title: Edit this block
  group: region_taxonomy_term
  route_name: regions.taxonomy_term.edit_form_header
  weight: 10
  options:
    fragment: 'edit-group-header'
New contributor
WiseUA is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

This is not possible because the anchor tag is never sent as part of the HTTP request by any browser, it is only interpreted locally within the browser.

RFC 1808 Section 2.4.1 - "Note that the fragment identifier is not considered part of the URL."

Your Answer

WiseUA is a new contributor. Be nice, and check out our Code of Conduct.

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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