Page 1 of 1

Opening a PicLens RSS feed from a standard page

Posted: 31 Jul 2008, 11:16
by progenitor
Hi, a strange request I know but...

Is it possible to open a PicLens gallery from a non-phocagallery menu page?
i.e. have an RSS feed created ready on a gallery page and then on another page have a button that takes the user straight into the PicLens experience. I've found that I can use code similar to the below to launch the gallery:

Code: Select all

<a href="javascript:PicLensLite.start({feedUrl:'yourfile.xml'});">
I know that when I create a Phoca Menu item in the Joomla Admin extra styles and code is added to the <head> of my page, e.g.

Code: Select all

  <!--[if IE]>
<link rel="stylesheet" href="/components/com_phocagallery/assets/phocagalleryieall.css" type="text/css" />
<![endif]-->
  <style type="text/css">
 #phocagallery .name {color: #ffffff ;}
 .phocagallery-box-file {background: #000000 ; border:1px solid #333333;margin: 5px;padding: 5px;}
 .phocagallery-box-file-first { background: #000000; }
 .phocagallery-box-file:hover, .phocagallery-box-file.hover {border:1px solid #666666 ; background: #050505 ;}
 .ol-foreground { background-color: #f6f6f6 ;}
 .ol-background { background-color: #666666 ;}
 .ol-textfont { font-family: Arial, sans-serif; font-size: 10px; color: #000000 ;} .ol-captionfont {font-family: Arial, sans-serif; font-size: 12px; color: #ffffff ; font-weight: bold;} </style>

  <!--[if IE]>
<style type="text/css">
phocagallery-box-file{
background-color: expression(isNaN(this.js)?(this.js=1,
this.onmouseover=new Function("this.className+=' hover';"),
this.onmouseout=new Function("this.className=this.className.replace(' hover','');")):false););
} </style>
<![endif]-->
  <style type="text/css"> 
 #sbox-window {background-color:#000000;padding:10px} 
 #sbox-overlay {background-color:#000000;} 
 </style>
  <link id="phocagallerypiclens" rel="alternate" href="/images/phocagallery/1.rss" type="application/rss+xml" 
	            title="" />
	        <script type="text/javascript" 
	            src="http://lite.piclens.com/current/piclens.js"></script>
  <style type="text/css">
 .mbf-item { display: none; }
 #phocagallery .mbf-item { display: none; }
 </style>
Is there anything else I would need to add?

I suppose this could just be added to my templates code - or is there a better way to save on loading all the extra css & js on all pages? - e.g. I may be able to load this in through a module position?

Re: Opening a PicLens RSS feed from a standard page

Posted: 31 Jul 2008, 11:33
by Jan
no idea, you must test it... but I think the css and javascript module loading can be a solution but then you can get two identical links:

if you go to gallery (loading of css and js by gallery) and the same by the module... so you can solve it with some if clause (see Phoca Gallery Plugin version 1.8.1 - there I solved the link should be loaded only one time)

As I know, you need to add the javascript link and rss link and then it should work...

Re: Opening a PicLens RSS feed from a standard page

Posted: 31 Jul 2008, 14:24
by progenitor
Sort of have it working. It works in Firefox but not Internet Explorer and Opera. :x
You can see it here.

I added a new module position to my templates index.php file:

Code: Select all

<?php if ($this->countModules('headblock')) : ?>
	<jdoc:include type="modules" name="headblock" style="none" />
<?php endif; ?>
and then added it in the templateDetails.xml file:

Code: Select all

<position>headblock</position>
I then added a new Custom HTML module to the position headblock with the following:

Code: Select all

<!--[if IE]>
<link rel="stylesheet" href="/lawson/components/com_phocagallery/assets/phocagalleryieall.css" type="text/css" />
<![endif]-->
  <style type="text/css">
 #phocagallery .name {color: #ffffff ;}
 .phocagallery-box-file {background: #000000 ; border:1px solid #333333;margin: 5px;padding: 5px;}
 .phocagallery-box-file-first { background: #000000; }
 .phocagallery-box-file:hover, .phocagallery-box-file.hover {border:1px solid #666666 ; background: #050505 ;}
 .ol-foreground { background-color: #f6f6f6 ;}
 .ol-background { background-color: #666666 ;}
 .ol-textfont { font-family: Arial, sans-serif; font-size: 10px; color: #000000 ;} .ol-captionfont {font-family: Arial, sans-serif; font-size: 12px; color: #ffffff ; font-weight: bold;} </style>

  <!--[if IE]>
<style type="text/css">
phocagallery-box-file{
background-color: expression(isNaN(this.js)?(this.js=1,
this.onmouseover=new Function("this.className+=' hover';"),
this.onmouseout=new Function("this.className=this.className.replace(' hover','');")):false););
} </style>
<![endif]-->
  <style type="text/css"> 
 #sbox-window {background-color:#000000;padding:10px} 
 #sbox-overlay {background-color:#000000;} 
 </style>
  <link id="phocagallerypiclens" rel="alternate" href="http://3k.co.uk/lawson/images/phocagallery/1.rss" type="application/rss+xml" title="" />
	        <script type="text/javascript" 
	            src="http://lite.piclens.com/current/piclens.js"></script>
  <style type="text/css">
 .mbf-item { display: none; }
 #phocagallery .mbf-item { display: none; }
 </style>
The button link uses the following code to launch the PicLens:

Code: Select all

<a href="javascript:PicLensLite.start({feedUrl:'http://3k.co.uk/lawson/images/phocagallery/1.rss'});">Click Here</a>

Re: Opening a PicLens RSS feed from a standard page

Posted: 31 Jul 2008, 21:01
by Jan
yes I have started it with FF, not with Opera :(

Re: Opening a PicLens RSS feed from a standard page

Posted: 04 Aug 2008, 16:31
by progenitor
Any ideas how I can get this working in Opera and IE?
I'm not sure what else to do.

Re: Opening a PicLens RSS feed from a standard page

Posted: 04 Aug 2008, 22:45
by Jan
no :(

Re: Opening a PicLens RSS feed from a standard page

Posted: 05 Aug 2008, 10:34
by progenitor
I may have a half solution. Okay so it won't work on standard pages but if I create another phocagallery menu item and then add a specific style to that page:

Code: Select all

#phocagallery	{display:none; }
I can Hide the gallery section, and still launch it from a button/text link like I want. :twisted:
It's not perfect but no one would ever know unless they disabled their stylesheets...

Re: Opening a PicLens RSS feed from a standard page

Posted: 05 Aug 2008, 14:09
by Jan
ok, try to chek the module (random image module, tree module ... only if you use them) if they create correct URL after the changes...

Jan