I have a Drupal 8 page views with contextual filter, and path of the same is like:
/category/%cid/product/%pid
Here %cid and %pid are contextual filters of the page view.
In this page, I want to change my footer menu, to alter the links so that:
/privacy-policy
becomes
/productname/privacy-policy
only if any node created and it has url path settings:
/productname/privacy-policy
How to achieve this.
Note: based on the discussion in Drupal I tried,
- To alter routes, implement a RouteSubscriber
- To alter menu links, use hook_menu_links_discovered_alter()
I can not achieve this.