Community

Auto-generate urlpath to article based on menu path

Hi,

I have a page that renders a view which in turn shows a list of articles. Once I click on an article to view its full content, the urlpath does not follow the parent anymore.

I have for example this menu structure. There is the page "Resources" (urlpath: /resources) with one child page, "Articles" (urlpath: /resources/articles). When I click on "Articles", a view is rendered that shows a list of articles based on tags. All fine but when I click on a specific article (e.g. My Test Article), the urlpath changes into "/my-test-article". I would expect it to be "/resources/articles/my-test-article".

Because of this I lose breadcrumbs and active menu trail. I know that articles are not linked to a certain parent and I know that one article can show up in different views on different pages so this kind of makes sense. Still I believe there must be a way to simulate this "article belong to parent" functionality.

I can manually alter the urlpath of every article but this looks like a primitive option. Then of course I can have one article show in more than one page so different urlpaths are needed.

I am new to Drupal so maybe I miss the right approach. Can anyone point me into the right direction? Help is greatly appreciated.

Comments

try this module

ꦱꦠꦽꦶꦪ

already tried

I already tried this module. I have it installed and working for the whole page structure but could not figure out what I need to do to make it work for nodes like articles. I have set up a default path pattern [node:menu-link:parents:join-path]/[node:title] which seems to work ok for nested menu links. Not for articles though.

When I create a new basic page and check the option to add a menu link, the right urlpath is automatically generated based on that menu link's parent tree. This does not happen for articles as for them I do not check that option to have a menu link. Articles are supposed to be neutral and just show on whatever page I decide to show them.

I do not have experience with Drupal, let aside Pathauto. Maybe my default pattern is not the right choice for what I need in regards to the articles. It is just that no other replacement pattern stands out as more appropriate. Maybe someone that has already solved such a situation can point it out for me. That would be a huge help.

nobody click here