On my site I have a ddblock on the frontpage that shows only 5 nodes. I also have another ddblock on my site that shows all of the nodes of that type. What I would like to do is link from the frontpage slide to that other page, and have the second ddblock be displaying the correct node based off of which they linked from. I already know how to edit the link and have it going to the correct page, I just don't know how to supply it with the correct argument (or whatever it needs) to make the right node show up. Any help is appreciated, thanks!

Comments

ppblaauw’s picture

Assigned: frederis » Unassigned
Status: Active » Postponed (maintainer needs more info)

As I understand right in the first ddblock slideshow you added a link to second ddblock slideshow but this second slideshow needs an argument with the content type.

In your second view you would need to add an argument for the content type and add this argument to the link from the first view.

Hope this helps you further, please let me know.

P.S. Tip, just to inform you:
I see this is your first post in an issue queue. When you assign an issue to yourself it means that you will look into this yourself, nobody has to do something. To get help from others, leave it to unassign.

frederis’s picture

I guess I'm confused as to how I add an argument that is changing the link when the view isn't actually controlling the page, just the block that is showing on it. I tried adding an argument with the nid that I could add to the end of the link, but that isn't working correctly. I understand how to add arguments, just not how to actually use them to change which node is showing in the ddblock embedded in that page. If my view was a page view I think I could do it, but its a block and its just confusing me.

Thanks for the quick response btw, and thanks for letting me know about the whole assigned vs. unassigned setting. I appreciate any more help you can give me on this issue.

ppblaauw’s picture

In your first view add a field with the URL to the page with the second view.
The URL is something like http://example.com/node/10/[content_type_name]

node/10 contains the second ddblock slideshow.

In the view of the second ddblock slideshow

Add argument for a block

  1. Click plus sign button under Arguments fieldset.
  2. Click Add button.
  3. Add argument Node: Type.
  4. Click Add button and set the following:
    Title: leave it empty
    Action to take if argument is not present: Check radio button Provide default argument
    Default argument type: Check radio button PHP Code
    PHP argument code: Type: "return arg(2);"
    Leave the other default settings
  5. Click Update default display.

arg(0) = node
arg(1) = 10
return arg(2) should get the [content_type_name] as argument

Did not test this, but hope this helps you further, please let me know.

frederis’s picture

After reading your solution, I think I might not have explained my setup that well so I'll try again.

I have a "Featured Item" content type on my site. On my frontpage, I have a ddblock that rotates through the 5 most recent nodes of the "Featured Item" content type. On another page on my site, I have a ddblock showing that rotates through ALL "Featured Item" nodes that are on my site.

When someone clicks on a particular node in my frontpage ddblock, they will always be taken to that page with the second ddblock. Right now, however, that second ddblock will always start at the first node in it's rotation, rather than be displaying the node they clicked on. All the "Featured Item" nodes will still be displayed in that second ddblock's rotation, I just want it to START on whatever node they linked from.

Maybe you understood what I meant the first time and I'm just not getting how that argument setup you described would work. Hopefully I was clearer this time as to what I'm trying to do. Thanks for the help!

ppblaauw’s picture

Title: Linking to another ddblock page with the correct node displayed » Howto link to another ddblock slideshow and start with a specific slide defined as an argument in the link?
Status: Postponed (maintainer needs more info) » Active

Thanks for explaining again what you want to accomplish. I misunderstood your earlier descriptions. I get it now, but I don't have a direct answer how to accomplish this.

The cycle plugin has a "startingSlide" option to define which slide to start with.

Will look at this when I have some free time and let you know when I come up with a solution, although I am very busy at the moment with other things. It can take some time before I can have a look at this.

Changed the issue title.

frederis’s picture

Just wondered if you had made any progress on this request yet? If it might still be quite a long time before you can get to this, I wonder if maybe you could give me a little direction and I could attempt to get it figured out myself? Thanks

ppblaauw’s picture

Status: Active » Postponed (maintainer needs more info)

Hi, another user asked for the same question and I found a solution for this.

When you use in your URL to the slideshow a starting slide with an argument like slidenum=3 the slideshow will start with slide 4 (slideshow starts with slide 0)

http://www.example.com?slidenum=3

In the ddblock.js file you need to add just before //simple block at line 203 the following code:

      //start with slidenr from URL
      
      function getUrlVars() {
        var vars = [], hash;
        var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
        for(var i = 0; i < hashes.length; i++) {
          hash = hashes[i].split('=');
          vars.push(hash[0]);
          vars[hash[0]] = hash[1];
        }
        return vars;
      }  

      
      var startThisSlide = getUrlVars()["slidenum"];
      if (startThisSlide > 0 ){
        options.startingSlide = startThisSlide;
      }

Hope this helps you further, please let me know.

patterndev’s picture

item closed - I was able to solve my problem. I had incorrect code in the default argument for the view. thx