Scroll To Top

Enter a query to search our site. Note that you can use "*" and "?" as wildcards. Enclosing more than one word in double quotes ("CSS Layout") will search for the exact phrase.

PVII Knowledge Base

1. Select a product ...
2. Select category ...
3. Search the Knowledge Base...

Question #246

Is it possible to link to a Lightshow Magic page and have it auto open with a specific slide number? perhaps using url parameters or page anchor?

The Answer

Prepared Sep. 2008 by Gerry Jacobsen, PVII

You can have the Lightshow Magic system auto start with a specific slide by based on url parameters, either a anchor or an url parameter, but you will need to apply this code tweak:

Note: You will not want use the tech note #245 tweak, if you have added it, remove it.

1. Open the p7LSM.js scripts file and copy and paste this new code function at the end of the scripts file:

function P7_LSMurl(){
  var i,h,s,x,nn,d='lsm';
  if(document.getElementById){
   h=document.location.search;
   if(h){
    h=h.replace('?','');
    s=h.split(/[=&]/g);
    if(s&&s.length){
     for(i=0;i<s.length;i+=2){
      if(s[i]==d){
       x=s[i+1];
       nn=x.split("_");
       if(nn&&nn[1]){
        P7_LSMctrl(nn[1],'p7LSM_'+nn[0],1);
       }
      }
     }
    }
  }
  h=document.location.hash;
  x=h.substring(1,h.length);
  if(x&&x.indexOf(d)===0){
    nn=x.replace(d,'').split("_");
    if(nn&&nn[1]){
      P7_LSMctrl(nn[1],'p7LSM_'+nn[0],1);
    }
   }
  }
 }

2. Next, locate the last few lines of the P7_LSMinit() function, around line 280:

  P7_LSMpause(1);
p7LSMf=true; }

3. Add a new lone after the "p7LSMf=true;" line and paste this into the new line:

  P7_LSMurl();
  

so it now looks like this:

  P7_LSMpause(1);
  p7LSMf=true;
  P7_LSMurl();
  }

4. Save and close the file.

To deploy the tweak:

Lightshow Magic will now run the automated opener detection system that will look for a special URL parameter in the current page address and will open the specified content panel. The opener will look for the LSM component number, an underscore, and the LSM slide number to open.

Anchor Method:

The system will look for lsm plus a slide number after the anchor. The anchor, index.htm#lsm1_4, will trigger slide 4 in the first LSM system on the page.

URL Parameter Method:

The system will look for lsm= in the URL parameter. A URL parameter, index.htm?lsm=2_3, will trigger slide 3 in the second LSM system on the page. You can then give out the entire link, plus the parameter, so people can go directly to your specific content panel.

Back to the questions list