1

Each user, lets say performer has profile page (which is node, not default user page) which is visible and can be made once..
Band (for example "Cool Band") can create image gallery, video gallery, bio, concerts etc...
On registration each user has to enter unique profile name (field_profile_name, in our case Cool Band)

After registering, user picks band node and path is created as his main profile page with pathauto (sub-pathauto is installed too):
example.com/performer/[node_author_field_profile_name] = performer/cool-band

After saving the node he gets new role which can not make new nodes of this type, and link can not be changed.

Views contextual are setup to show different content made by user, resulting in paths:
example.com/performer/%/photo-gallery = performer/cool-band/photo-gallery example.com/performer/%/video-gallery = performer/cool-band/video-gallery example.com/performer/%/concerts = performer/cool-band/concerts

What i can not figure out is how to create sidebar menu block which will lead to those pages, so when site visitor lands on any bands page he can see sidebar with links to other part of bands pages. Sidebar menu should show link like this:

example.com/performer/cool-band/photo-gallery
example.com/performer/cool-band/video-gallery
example.com/performer/cool-band/concerts

I have tried to create view (users) with "overwrite this field as a link" and link is: performer/[field_profile_name]/photo-gallery etc., but i can not get the contextual right way.

  • do you have the relationship to user in your view, and if so, did you bring in the profile_name in as a field? – longboardnode May 25 '16 at 21:26
  • Yep, in field i am using profile_name field, rewriting it to what i have wrote in last part of question, in relationship i have user:content authored (required), but not sure what to add and how to setup contextual filter (user_profile_name) ? – Azz Kawa May 25 '16 at 21:58
  • Ok, and when you say What i can not figure out is how to create sidebar menu block which will lead to those pages is your question then about how to set up the menu links or how to process the contextual filter when in the view? – longboardnode May 26 '16 at 2:16
  • Both. Sidebar menu with contextual links from view. – Azz Kawa May 26 '16 at 7:23
2

Considering your previous question and our conversation you left out quite some details ;)

The sidebar should appear on the band-page (and the child pages photo-albums, etc) only right?

  • Create a Views block (type: content) with a contextual filter Content: nid and choose Provide default: Content ID from URL.
  • Then under format make sure it is set to fields not to content.
  • Add a field Content: path and hide it from display.
  • Add a field Global: textarea, enable replacement tokens and use the path as a base path, so you enter all your urls like:

    <a href="[path]/photo-gallery">Photo gallery</a>
    <a href="[path]/video-gallery">Video gallery</a>
    ...
    

This should give you a list of links that all use the path alias of the band-page node, and then attach another path item to it.

The only thing you won't have is an active trail, so the active page will not be highlighted in the menu. I don't know how to achieve that.

And finally make sure to only display this block on band pages and direct child pages, otherwise you'll get some strange links. Since you are using Sub-pathauto all links should continue to work even if you are visiting a child page, as long as you don't use a stand alone node as child (in this case the path will resolve to that node page).

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.