Slideshow Plugin

Slideshow Plugin, a forum discussion on Jojo CMS. Join us for more discussions on Slideshow Plugin on our Plugin Support forum.

Back to Forum Index : Back to Plugin Support   RSS
lynchpin

9 Jul 2008
Posts: 60

I'm working on integrating the jojo_slideshow plugin so that I can specify a specific slideshow on each page. I have added a field called pg_header to page table that allows to select a slideshow.
Now, my only problem is including the slideshow in my template file.
According to the slideshow documentation, this is the tag needed:
[[slideshow:{$pg_header}]]

If I insert this tag into a page body and replace the pg_header with my slideshow id, it works fine, but when I use this in the template file, it just outputs this as it is:
[[slideshow:1]]

It seems that the plugin is being called before this tag is picked up. Is there a way around that?
lynchpin

10 Jul 2008
Posts: 60

I am all set.
I was able to call the 'getSlideshow' function in my global.php file and assign the slideshow id to the name variable. I then included the slideshow template file in the template, and working great now!
Here it is if anyone is interested:
http://www.newcitydenver.org/layout/

tom

Developer

tom

23 Jul 2008
Posts: 379

I was having a similar issue with Youtube plugin.. the trick (in order to get it working as you originally planned) is including the filter twice in the api file for the plugin:

eg
Jojo::addFilter('content', 'youtube', 'jojo_youtube');
Jojo::addFilter('output', 'youtube', 'jojo_youtube');

'content' checks the body content for the [[ reference ]]
'output' checks again after smarty has finished with the template.
this way you can have filter references in the body or the template.

Using just 'content' means references in the template get ignored, using just 'output' means that smarty will convert [[ ]] in the body to htmlentities before the filter has a chance to look for them

lynchpin

23 Jul 2008
Posts: 60

Good to know. Thanks for the info
raulandres

1 Jul 2009
Posts: 35

hello tom i have same problem

i added this on api.php on slideshow plugin on mysite directory

Jojo::addFilter('content', 'applyContentVars', 'jojo_slideshow');
(added)Jojo::addFilter('output', 'applyContentVars', 'jojo_slideshow');

i want call slideshow plugin from my template, i added:
[[slideshow:1]] but i dont get its work

always, thx! i think so one early day is possible contribution jojocms anyway


tom

Developer

tom

1 Jul 2009
Posts: 379

:)
i'll add that in
Thanks.
raulandres

2 Jul 2009
Posts: 35

its doesnt work for me, what did lynchpin for get it? do you know?
tom how to call any plugin from templates? any doc? thx
tom

Developer

tom

2 Jul 2009
Posts: 379

Hmm. You can call any plugin from a template as long as there is an output filter in api.php that calls a function in the plugin that return the html content you want to display.

What you added should work fine - did you do a force refresh?

api.php is automatically collated from all plugins into a single file and cached, so you need to force it to rebuild to include any new lines.
raulandres

2 Jul 2009
Posts: 35

ok tom, what is force refresh, CTRL + F5 in browser or another thing? thx

my line added on api.php is: Jojo::addFilter('output', 'applyContentVars', 'jojo_slideshow'); is ok?
tom

Developer

tom

2 Jul 2009
Posts: 379

yes. that should do it.
raulandres

4 Jul 2009
Posts: 35

uhm, then it doesnt work

but, now it show me a error when run /setup

look image

i tried reinstall, uninstall slideshow plugin and rerun /setup but not sucess :(

it show me another user error too...
thx

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.