How to call a Gallery smarty tag from a UDT?
-
rogerlatur
- New Member

- Posts: 7
- Joined: Sat Aug 02, 2014 2:53 pm
How to call a Gallery smarty tag from a UDT?
I am trying to call this Smarty tag
{Gallery dir='Content_images' img='66'}
from a UDT, without success.
I've seen this example, but it does not work.
{Gallery dir='Content_images' img='66'}
from a UDT, without success.
I've seen this example, but it does not work.
Re: How to call a Gallery smarty tag from a UDT?
What are you trying to achieve?
Although possible, and in some situations the only solution to get an specific result, it's not recommended to use it if there are alternatives...
Although possible, and in some situations the only solution to get an specific result, it's not recommended to use it if there are alternatives...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How to call a Gallery smarty tag from a UDT?
Yes, it does!rogerlatur wrote:I've seen this example, but it does not work.
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
-
rogerlatur
- New Member

- Posts: 7
- Joined: Sat Aug 02, 2014 2:53 pm
Re: How to call a Gallery smarty tag from a UDT?
This tag is cool cause it adds an image and takes all lytebox parameters too (opens in a new window on click etc etc):Jo Morg wrote:What are you trying to achieve?
Although possible, and in some situations the only solution to get an specific result, it's not recommended to use it if there are alternatives...
Code: Select all
{Gallery dir='Content_images' img='66'} Code: Select all
{image_left_center_open}{Gallery dir='Content_images' img='47'}{image_right_center_open}{Gallery dir='Content_images' img='27'}{image_right_center_close}As I don't know where is the php to edit directly what the smarty tag "Gallery" does (I asked here but my question was never displayed), I thought I'd ask how to manipulate a tag in a tag!
I think it's much better if I can modify the php itself, but could not find it
Re: How to call a Gallery smarty tag from a UDT?
Maybe it is the call itself. It makes no sense to have the parameters dir and img at the same time.
Re: How to call a Gallery smarty tag from a UDT?
The question implied hacking the module so it violated the forum rules...rogerlatur wrote:As I don't know where is the php to edit directly what the smarty tag "Gallery" does (I asked here but my question was never displayed), I thought I'd ask how to manipulate a tag in a tag!
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How to call a Gallery smarty tag from a UDT?
I remember somebody asked in which file parameters are defined.
Was that you?
I don't agree that just asking where a file can be found, is a violation of forum rules
http://forum.cmsmadesimple.org/viewtopi ... 40&t=28132
But it wouldn't have helped you anyway.
In your content page you have nothing else to do than call the subgallery with {Gallery dir='yoursubgallery'}
Was that you?
I don't agree that just asking where a file can be found, is a violation of forum rules
http://forum.cmsmadesimple.org/viewtopi ... 40&t=28132
But it wouldn't have helped you anyway.
The proper way would be to create a subgallery, upload the two images, assign the gallery-template of your choice. You can create/copy a gallery-template and edit the css to get the extra space (margin).Now I'd like to be able to add 2 images, centered on the page (with a little distance between both, but that's a detail). To do so I'm actually adding UDTs before, between, after!
In your content page you have nothing else to do than call the subgallery with {Gallery dir='yoursubgallery'}
Last edited by Jos on Mon Aug 04, 2014 11:50 am, edited 1 time in total.
Re: How to call a Gallery smarty tag from a UDT?
I was just guessing by this statment:Jos wrote:I don't agree that just asking where a file can be found, is a violation of forum rules
viewtopic.php?f=40&t=28132
But it wouldn't have helped you anyway.
It wasn't me who moderated the post anyway so I don't really know about what was written on the deleted post other then by this statement.rogerlatur wrote:As I don't know where is the php to edit directly what the smarty tag "Gallery" does (I asked here but my question was never displayed)
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
rogerlatur
- New Member

- Posts: 7
- Joined: Sat Aug 02, 2014 2:53 pm
Re: How to call a Gallery smarty tag from a UDT?
It would be the first time for me that modifying an open source php file is considered as a hacking fact!
As long as you don't use it commercially, keep all copyrights, headers etc, I really don't see what would be wrong in doing this.
Imagine if nobody was able to modify anything, then the open source world would be dead since a long time.
As long as you don't use it commercially, keep all copyrights, headers etc, I really don't see what would be wrong in doing this.
Imagine if nobody was able to modify anything, then the open source world would be dead since a long time.
-
rogerlatur
- New Member

- Posts: 7
- Joined: Sat Aug 02, 2014 2:53 pm
Re: How to call a Gallery smarty tag from a UDT?
Now I see that I got the reason why my post was deleted.Jo Morg wrote:The question implied hacking the module so it violated the forum rules...rogerlatur wrote:As I don't know where is the php to edit directly what the smarty tag "Gallery" does (I asked here but my question was never displayed), I thought I'd ask how to manipulate a tag in a tag!
I thought you were jocking. It seems that you are not. Only pathetic.
-
rogerlatur
- New Member

- Posts: 7
- Joined: Sat Aug 02, 2014 2:53 pm
Re: How to call a Gallery smarty tag from a UDT?
I found the file.
Just that you know.:
Just that you know.:
Code: Select all
# This program is free software; [b]you can redistribute it and/or modify
# it under the terms of the GNU General Public License[/b] as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.-
rogerlatur
- New Member

- Posts: 7
- Joined: Sat Aug 02, 2014 2:53 pm
Re: How to call a Gallery smarty tag from a UDT?
I tried with this:Rolf wrote:Yes, it does!rogerlatur wrote:I've seen this example, but it does not work.
Code: Select all
$smarty = cmsms()->GetSmarty();
$smarty_data = "{Gallery}";
echo $smarty->display($smarty_data);Code: Select all
httpdocs/lib/smarty/Smarty.class.php:1593 - trigger_error
/httpdocs/lib/smarty/Smarty.class.php:1415 - _fetch_resource_info
/httpdocs/lib/smarty/Smarty.class.php:1254 - _compile_resource
/httpdocs/lib/smarty/Smarty.class.php:1106 - fetch
/httpdocs/lib/classes/class.usertagoperations.inc.php(260) : eval()'d code:8 - displayRe: How to call a Gallery smarty tag from a UDT?
I do hope I'm misinterpreting this...rogerlatur wrote:Now I see that I got the reason why my post was deleted.
I thought you were jocking. It seems that you are not. Only pathetic.
You can modify it all you want, but the rules are there for a reason: if you know what you are doing fine; if you don't, and the module stops working you most likely won't get support here. Others may apply the hack blindly and it may create more troubles that the ones it was eventually trying to solve;rogerlatur wrote:I found the file.
Just that you know.:Code: Select all
# This program is free software; [b]you can redistribute it and/or modify # it under the terms of the GNU General Public License[/b] as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version.
In conclusion: you can modify the module files; you can't post those modifications on the forum as they will be considered a hack and a violation of the forum rules;
I hope you do understand and, in the future, avoid labeling any of the members of this community...
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
Re: How to call a Gallery smarty tag from a UDT?
Rolf's UDT works fine like this
But I'd rather like to refer to the solution provided in my former post
Code: Select all
$img = isset($params['img']) ? $params['img'] : '';
$smarty_data = "{Gallery img='".$img."'}";
$smarty->display('eval:'.$smarty_data);-
rogerlatur
- New Member

- Posts: 7
- Joined: Sat Aug 02, 2014 2:53 pm
Re: How to call a Gallery smarty tag from a UDT?
No matter how I call it, with 'echo' or not, I always have the errors listed above.Jos wrote:Rolf's UDT works fine like thisCode: Select all
$img = isset($params['img']) ? $params['img'] : ''; $smarty_data = "{Gallery img='".$img."'}"; $smarty->display('eval:'.$smarty_data);
Maybe because I run version 1.10.3.
I tried yesterday to upgrade CMSMS and it turned to a real nightmare !
All UDTs broken etc etc.
First time ever I have an issue ugrading/updating a CMS. I guess I am getting old.
I agree. Thank you very much for the help.Jos wrote:But I'd rather like to refer to the solution provided in my former post




