Keyword

Simple Image Gallery does not work in k2

More
12 years 10 months ago #91224 by matthew turner
Replied by matthew turner on topic Simple Image Gallery does not work in k2
Hi Jock,

I think you could do this various ways - I don't have the gallery plugin that you are using to test...

 

try using 2 extrafields - 1 for the plugin defines (rows=1 cols=1 width=708 etc) and 2nd one for the folder path bit

which would be something like :

<?php echo JHTML::_('content.prepare', '{gallery '.$PluginDefines.'}'.$FolderName.'{/gallery}' ); ?>

 

I have just tested using the JoomlaWorks Gallery Pro plugin and the single extrafield did it for me using this as a test in the items extrafield :
food:50:24:0:1

 

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91225 by matthew turner
Replied by matthew turner on topic Simple Image Gallery does not work in k2
Hi Jock

I have just tried this another way using just the one extrafield which works!I used the following simpler code:

<?php echo JHTML::_('content.prepare', $mygallery2 ); ?>

 

You can then enter the complete plugin code including plugin overides into the extrafield box (rows=1 cols=1 etc)

For testing I used this in an extrafield text box {gallery}food{/gallery} mat said:

Hi Jock,

I think you could do this various ways - I don't have the gallery plugin that you are using to test...

 

try using 2 extrafields - 1 for the plugin defines (rows=1 cols=1 width=708 etc) and 2nd one for the folder path bit

which would be something like :

<?php echo JHTML::_('content.prepare', '{gallery '.$PluginDefines.'}'.$FolderName.'{/gallery}' ); ?>

 

I have just tested using the JoomlaWorks Gallery Pro plugin and the single extrafield did it for me using this as a test in the items extrafield :
food:50:24:0:1

 

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91226 by Jock
Replied by Jock on topic Simple Image Gallery does not work in k2
I Mat ... I appreciate your input.

 

Does this mean that there is no way you can change the K2 php code to get it to work with this kind of syntax. I struggle to understand why it works in the content editor but not in the extra fields? I would really rather avoid any such hacks ^

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91227 by matthew turner
Replied by matthew turner on topic Simple Image Gallery does not work in k2
Hi Jock,

As explained above by Rastislav and elsewhere - that is the way Joomla works, rightly or wrongly....

Joomla or K2 Plugins are specifically setup to be "run" only when inside intro content or main content areas.

The above code changes do work (at the top of my last post), but should be made to your K2 template over ride files so that no core files are over riden/hacked.

 

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91228 by Jock
Replied by Jock on topic Simple Image Gallery does not work in k2
You say that but why then does it work in the content tab?

 

If I place the following code in the content tab it works, place it in an extra field and it does not ... surely there is something fundamentally different in these segments of code which could be applied to the extra field to make it work like the content area does?

 

I just don't think the hack above is going to work for me and im amazed that the extra fields are not configurable this way.

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91229 by matthew turner
Replied by matthew turner on topic Simple Image Gallery does not work in k2
Hi Jock,

Not sure why, maybe server overheads, too many differences between plugin developers etc.- a question for the Joomla team I think !

In K2 the "Content tab" is the "intro content" and "main content" area which is why the plugins work there...

The code examples that I have written/edited for you have all been added and tested to fresh installs before I posted them, they do all work.

I am looking through my plug in collection to see if I have the one you are using to test....

 

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91230 by Jock
Replied by Jock on topic Simple Image Gallery does not work in k2
Out of interest I found this:

 

community.getk2.org/forum/topics/adding-html-code-into-extra?id=3536014%3ATopic%3A30464&page=1#comments

 

I cant seem to get it to work for me but it makes me think that there is a way to hack the php, what are your thoughts Mat?

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91231 by matthew turner
Replied by matthew turner on topic Simple Image Gallery does not work in k2
Hi Jock,

Yes I have already read that one along my journey getting the plug ins to work in the extra fields..

The downside of that approach (editing the core K2 files) and my main reason for not using it is that any future K2 updates could/will overwrite your hacks - and you would have to re add them again :(   and k2.5 is just round the corner...

However by using template over rides in your template folder, you can change how K2 displays/operates and not lose these changes when updating :)

Also because the over rides are in your template folder you can just delete them and K2 will be back to default again !

What is the name of the gallery plugin you are trying to use ?

 

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91232 by Jock
Replied by Jock on topic Simple Image Gallery does not work in k2
It's this one here:

 

hunyadi.info.hu/en/projects/sigplus

 

Works well, but just not in extrafields!

Please Log in or Create an account to join the conversation.

More
12 years 10 months ago #91233 by matthew turner
Replied by matthew turner on topic Simple Image Gallery does not work in k2
Hi Jock,

Yes that works in extrafields using the template over ride code i previously posted... !!

Nice gallery, not seen it before - thanks.

Plug in code I entered into a "Text Field" extra field which worked:

{gallery rows=3 cols=1 width=200 height=140 crop=1 labels=captions alignment=left orientation=horizontal buttons=0 links=0 counter=0 overlay=1}food/{/gallery}

 

I even have loadposition plugin running using the same code, and Joomlaworks Gallery pro plugin at the same time...

If this is for users to fill in you could re write the code where several extrafields make up the "whole" plugin string...?

And at the same time keep overall control of the layout / plug in over rides that you want eg pop up engine/light box used?

The options are limitless once you assign the extrafields to variables....

Extra images..

Mp3s...

Email links...

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum