Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
I'm wondering if its possible to pass arguments. I got a couple of blocks made with views and they work fine on default page but seems to not work at on view mode pages. (I'm talking about contextual filters)
Is there a reason for this or is there a workaround?
Comments
Comment #1
rballou CreditAttribution: rballou commentedI haven't had time to look at this, but I would also recommend looking at the hooks to see if they would be helpful at all. https://github.com/robballou/view_mode_page/blob/7.x-1.x/view_mode_page....
I'll try to look at this specifically soon. I assume this is a block containing a View that uses the NID as a contextual filter?
Comment #2
Strutsagget CreditAttribution: Strutsagget commentedHi yeah exactly i need the nid for a viewblock inside the viewmode. So far i use display suit and ?q=myviewmodename to do it but i rather have a real path for seo purposes. Ill try take a look when my current jobs dries up a bit... and see if i can help with a patch or if you beet me to the punch :)
Thx for replying!
Comment #2.0
Strutsagget CreditAttribution: Strutsagget commentedAdding more explaination
Comment #3
ThuleNB CreditAttribution: ThuleNB commentedHi there,
I am having the same issue (at least I think that's what the original poster meant).
I use VMP in order to display two additional view modes (also because of SEO reasons):
I use a views block to display view modes switcher links. This view contains a contextual filter for NID. The views' block is shown correctly on the original node (/country/[city]) but not on the two additional View Mode Pages.
I found out that if I set a contextual filter for my field [city] and choose 'unfiltered value from URL' > path component '2' ('use path alias' checked) the views' block is displayed also on the View Mode Pages. Unfortunately, using this way I get a problem if the values for [city] contain two words with a space.
Is there a solution or workaround for this problem?
EDIT Additional Information:
I tried to create my 'view mode switcher' links not using views but a menu with tokens:
Link 1: [nid]
Link 2: [nid]/bars
Link 3: [nid]/restaurants
Same problem than using views. The links show up on the original page but not on the two VMP pages. Somehow, the system doesn't recognise the original [nid].
Comment #4
rballou CreditAttribution: rballou commentedCan someone provide a pretty basic example of a View that would be used here? I haven't had a good opportunity to sit down and check this out in a while, but hopefully I can. Attaching a View export would be helpful for debugging.