1

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'
2
  • Why does it need to be defined in the route?
    – Kevin
    Commented Dec 4, 2018 at 16:40
  • @Kevin Because it's route for contextual links, and I have two routes for one page with "field_group" tabs.
    – WiseUA
    Commented Dec 4, 2018 at 16:44

2 Answers 2

4

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'
1

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

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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