Subdomain Install breaks jojo_slideshow

Subdomain Install breaks jojo_slideshow, a forum discussion on Jojo CMS. Join us for more discussions on Subdomain Install breaks jojo_slideshow on our Plugin Support forum.

Back to Forum Index : Back to Plugin Support   RSS
damien damien

2 Dec 2009
Posts: 24

Hey there JOJO Team

I have a fresh install setup on numerous sites, but when I've tried to setup a dev site on a subdomain, the jojo_slideshow plugin breaks.
The slideshow never changes the photo

My subdomain setup is here: http://t1cms.hqt1.com
Normal domain setup is here: http://www.t1create.com (works here)

Any ideas on the problem?

Thanks,
Damien
tom

Developer

tom

2 Dec 2009
Posts: 379

if you run Charles/Firebug on it, are you able to see where it's failing?
can you post what the error is that your getting?

I'm guessing most likely the Javascript isn't being found, which would probably be solved by using an absolute {$SITEURL}/ link to the script.

or the Javascript contains src references which are not being found, so can't find the new image, which may also be solved by including an absolute reference.

or the cached Javascript for the site includes references to a previous domain before you switched it to the subdomain, which should be solved by a force refresh, but may require emptying the mysite/cache folder.
damien damien

4 Dec 2009
Posts: 24

Hi Tom, thanks for the reply

No errors showing up in the Console for Firebug or Chromes one

The javascript for the slideshow is part of the JS folder, so its included as part of common.js, and I can find it in the cached copy, and live.

There's only one SRC reference I can find in the JS, and its pointing to the correct site. And the second Image definitely exists. And the <span> in the slideshow DIV that contains the SRC of the next time, is correct.

I even tried clearing the cache, deleting the cache folder and using setup to recreate. But nothing seems to work.

I do however ponder about the permissions and ownerships of our cache folders. I remember JOJO used to have everything CHMOD 777 in the Cache folder, Now theres several different levels of permission. Auto created by setup.

I've attached a screenshot of the cache folder contents (cache folder is 777)
tom

Developer

tom

4 Dec 2009
Posts: 379

Is it just me or are there no banner images on the subdomain site?
http://t1cms.hqt1.com
<div class="banner"></div>
aberratio

4 Dec 2009
Posts: 10

I tried to investigate your problem, but currently there is no code inside the <div class="banner"> on your subdomain. Did you remove it for testing purposes?
damien damien

4 Dec 2009
Posts: 24

Sorry i moved the dev site to a non subdomain location
Here's the new URL:

http://www.lovemarketit.com
aberratio

4 Dec 2009
Posts: 10

Not a solution, but further details: when the slideshow is initialized, the background of the #banner div gets set, but the images are not added to the DOM.
aberratio

4 Dec 2009
Posts: 10

And, of course:

On your t1create.com page you have an image (<img class="current" src="images/700x88/jojo_slideshowimages/slideshowBanner1.jpg" alt="" title="" />) in the banner div, followed by the <span>s that hold the substitution images.

At the lovemarketit.com page, this image is missing.
damien damien

7 Dec 2009
Posts: 24

Any further ideas on this?

Do you think someone at the JOJO team could have a look at this
Paid, if needed?
aberratio

7 Dec 2009
Posts: 10

What I've been talking about are the things that seem to be wrong with the generated html code. So, what is the reason for the missing image tag?

Could you please provide your php code and template code that you use to generate the page at this position? Is it exactly the same on both pages (the working and the non-working one)?
tom

Developer

tom

8 Dec 2009
Posts: 379

Many Jojo plugins are written by one of us, for a particular purpose, and the rest of us may never use it, or know anything about it. jojo_slideshow isn't a plugin I've ever had anything to do with - we generally use bannerimage for that sort of thing. It would help, if as aberratio said, you provided a bit more info, but, looking at the code briefly...

is the template engine for all these sites set to dwoo? if so it may be failing because of the way the section is structured in the template. does it work if you switch it to Smarty?

if so, try replacing the section with this:

{foreach name=ss from=$slideshows item=s}
{if $smarty.foreach.ss.first}
<img class="current" src="images/{$slideshow.width|default:300}x{$slideshow.height|default:200}/jojo_slideshowimages/{$s.image}" alt="" title="{$s.title}" />
{else}
<span rel="images/{$slideshow.width|default:300}x{$slideshow.height|default:200}/jojo_slideshowimages/{$s.image}" title="{$s.title}"></span>
{/if}
{/foreach}


Also, I don't understand how the javascript is ever supposed to run with that code - can you try replacing (in the template again) the script with:

<script type="text/javascript">
$(document).ready(function(){
jojo_slideshow('{$slideshow.name}',{$slideshow.delay},{$slideshow.fadespeed});
});
</script>

and let me know how you get on. if either/both of those changes work, i'll commit them. I'm not running it here anywhere, so can't test those changes myself.
aberratio

8 Dec 2009
Posts: 10

Yes, it seems to be a problem with using the smarty syntax with dwoo.

I got it working with

--
<div id="{$slideshow.name}" style="width: {$slideshow.width|default:300}px; height: {$slideshow.height|default:200}px;" class="jojo_slideshow">
{foreach from=$slideshows item=s key=k}
{if $k==0}
<img class="current" src="images/{$slideshow.width|default:300}x{$slideshow.height|default:200}/jojo_slideshowimages/{$s.image}" alt="" title="{$s.title}" />
{else}
<span rel="images/{$slideshow.width|default:300}x{$slideshow.height|default:200}/jojo_slideshowimages/{$s.image}" title="{$s.title}"></span>
{/if}
{/foreach}
</div>
--

The JavaScript is OK and works.

Tom, the jQuery syntax with "function(){" confuses the template engine and causes PHP errors. Might work with escaping the {, if dwoo supports this.
tom

Developer

tom

8 Dec 2009
Posts: 379

ah yes, sorry - dwoo supports {literal} and {ldelim}. if it's working as is tho, probably wouldn't worry about it - hadn't seen that shortcut format for calling a function via jquery before is all. Presumably it waits for document ready before running it?
aberratio

8 Dec 2009
Posts: 10

You can get rid of the in-page JS by adding something like this to the functions.js. It calls the jojo_slideshow() funtion for every DOM object with class="jojo_slideshow". The information about the delay and fadespeed need to be given by the slideshow div, i have put it into the rel attribute.

Template:

<div id="{$slideshow.name}" class="jojo_slideshow" rel="{$slideshow.delay|default:5000},{$slideshow.fadespeed|default:10000}" style="width: {$slideshow.width|default:300}px; height: {$slideshow.height|default:200}px;" >


functions.js:

$(document).ready(function(){
$('.jojo_slideshow').each(function(){
var slideshow_name = this.id;
var relcontent = $('#'+slideshow_name).attr("rel");
var relArray = relcontent.split(",");
var slideshow_delay = relArray[0];
var slideshow_speed = relArray[1];
jojo_slideshow(slideshow_name,slideshow_delay,slideshow_speed);
});
});
aberratio

8 Dec 2009
Posts: 10

The jQuery Syntax "$(jojo_slideshow('test',2000,100));" does not implicitly include a "$(document).ready(function()". So it worked by accident, because the DOM was already loaded when the function was called.
aberratio

8 Dec 2009
Posts: 10

The same thing, with a check for the rel attribute. But this is not really necessary, since jojo_slideshow() validates delay andspeed input.

$(document).ready(function(){
$('.jojo_slideshow').each(function(){
var slideshow_name = this.id;
var relcontent = $('#'+slideshow_name).attr("rel");
if(typeof relcontent == 'undefined')
{
jojo_slideshow(slideshow_name);
}
else
{
var relArray = relcontent.split(",");
jojo_slideshow(slideshow_name, relArray[0], relArray[1]);
}
});
Back to Forum Index : Back to Plugin Support   RSS
You must be logged in to post a reply



You need to Register or Log In before posting on these forums.