1

When I create a view with the path blog/%, the menu link "My blog" disappear from the main menu but still exists in the database. The view works exactly as expected when I go to /blogs and click the nav link at the bottom of the article.

Already tried without success (logged in as administrator)

1) Change view access to:

  • none
  • permission: view published content
  • permission: blog entry:
  • create new content role: authenticated users

2) Add/Remove the view filter: status published

3) Create a new menu link using Menu Token module but this link disappears too (but still exists in the db).

4) Enable/disable Menu Token and Menu item visibility modules, just to check if there is a conflict somewhere but it doesn't change anything.

Versions:

  • Drupal 7.31
  • Blog 7.31
  • Views 7.x-3.8.
  • Menu Token 7.x-1.0-beta5
  • Menu item visibility 7.x-1.0-beta1
1

The path that the blog module uses is blog/%user .

If you go to blog/1 you will see all posts made by the user with uid equals 1.

So, when you create a views:view that defines the path blog/%, it overrides the default path previously defined by blog and uses the views path.

| improve this answer | |
  • Thanks, but I still don't understand why the menu link disappears: the path is overriden, not the menu link. Views module do not allow to create menu links with arguments. – Naomi Sep 26 '14 at 15:35
  • The "my blog" menu link is the default menu link that comes with the blog module or its a custom menu link that you created? The way that drupal handles menu links connects each link to a path. If you see the [link]api.drupal.org/api/drupal/includes!menu.inc/function/…, two variables are required, the path and the title. So, if you override the path, the menu router will not display that menu link (since the path it was suposed to point to is not acessible anymore). – nimbfire Sep 26 '14 at 17:07
  • I tried with a custom menu link but it disappears from the menu when the view path contains an argument. Now I have deleted it, and try to make the default link (system) work. – Naomi Sep 26 '14 at 19:01
  • Thanks for the doc, I understand that 2 arguments are required but these are already stored in the db. I have checked "override title" in the contextual filter "author UID", but it does not work. What am I supposed to do? I guess I should start again with a new content type and disable the blog module. – Naomi Sep 26 '14 at 19:17
  • what do you want? a page that uses views to show the posts AND a page that shows only the posts from a determined user? – nimbfire Sep 26 '14 at 20:17

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.