Page 1 of 1

CGBlog & Gallery

Posted: Sun Nov 18, 2012 1:18 pm
by JohnnyNM
I think I've reached my wits end!

I'm trying to feed a variable to Gallery from a CGBlog detail template.

The variable 'GalleryName' concatenates ok, and it prints to the page fine, however the 'dir' option in the Gallery tag doesn't seem to take it and returns nothing.

Anyone got an idea? Thanks in advance!
John.

Code: Select all

{assign var=GalleryName value="ArticleGallery/"|cat:$entry->GalleryName}
{$GalleryName}


{if $entry->GalleryName != ""}
{Gallery dir=$GalleryName}
{/if}



----------------------------------------------

Cms Version: 1.11.2.1

Installed Modules:

CMSMailer: 5.2.1
CMSPrinting: 1.0.3
FileManager: 1.4.1
MenuManager: 1.8.4
MicroTiny: 1.2.3
ModuleManager: 1.5.5
News: 2.12.9
Search: 1.7.7
ThemeManager: 1.1.7
CGExtensions: 1.31.1
Banners: 2.6
CGSimpleSmarty: 1.5.2
CGBlog: 1.9.8
Gallery: 1.6


Config Information:

php_memory_limit:
process_whole_template:
output_compression:
max_upload_size: 12000000
url_rewriting: none
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true


Php Information:

phpversion: 5.2.10
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 0
memory_limit: 48M
max_execution_time: 30
output_buffering: On
safe_mode: Off (False)
file_uploads: On (True)
post_max_size: 8M
upload_max_filesize: 12M
session_save_path: /tmp (1777)
session_use_cookies: On (True)
xml_function: On (True)
xmlreader_class: On (True)


Server Information:

Server Api: apache2handler
Server Db Type: MySQL (mysqli)
Server Db Version: 5.0.96
Server Db Grants: Found a "GRANT ALL" statement that appears to be suitable


----------------------------------------------

Re: CGBlog & Gallery

Posted: Sun Nov 18, 2012 1:51 pm
by Jos
Try
{cms_module module='Gallery' dir=$GalleryName}
I believe its a Smarty3 thingy

Re: CGBlog & Gallery

Posted: Sun Nov 18, 2012 2:00 pm
by JohnnyNM
Jos wrote:Try
{cms_module module='Gallery' dir=$GalleryName}
I believe its a Smarty3 thingy
Thanks, but no luck on that one I'm afraid. :( Any other ideas?

I've tried, at least I think I did it right, trying to pre-process the smarty template and then echo the variable through php, but that exits the page just before that section.
J.

Re: CGBlog & Gallery

Posted: Sun Nov 18, 2012 2:02 pm
by Jo Morg
JohnnyNM wrote:

Code: Select all

{assign var=GalleryName value="ArticleGallery/"|cat:$entry->GalleryName}
{$GalleryName}


{if $entry->GalleryName != ""}
{Gallery dir=$GalleryName}
{/if}
Assuming all the rest is default and {$GalleryName} is, as you say, valid
I would test if "uploads/images/Gallery/<whatever{$GalleryName}VarHoldsHere>" actually exists...
Gallery help wrote:Parameters

(optional) dir="sub1/sub2" - Parameter to specify a directory, relative to uploads/images/Gallery/
Just an idea...

<edited> I used a wrong path as an example.... just corrected it

Re: CGBlog & Gallery

Posted: Sun Nov 18, 2012 2:35 pm
by JohnnyNM
Thanks. The path itself exists on the server and if I replace the variable with its contents, then the gallery appears.

So I know the variable works, and the gallery code works, but getting Gallery to pull a variable directly seems to be the problem.

I've also just tried it on another version of the cms for a different site and it's worked with this code:

Code: Select all

{assign 'GD' 'Graphic-Design'}
{Gallery dir=$GD}
Now this one worked for some reason...same server, same everything. :s and these are the specs. The only thing I can think is its running Gallery 1.5.3 rather than version 6. :/

J.

----------------------------------------------

Cms Version: 1.10.3

Installed Modules:

CMSMailer: 2.0.2
CMSPrinting: 1.0
FileManager: 1.2.0
MenuManager: 1.7.7
MicroTiny: 1.1.1
ModuleManager: 1.5.3
News: 2.12.3
Search: 1.7
ThemeManager: 1.1.4
Gallery: 1.5.3
CGSimpleSmarty: 1.5
CGExtensions: 1.29.1
CGBlog: 1.9.8


Config Information:

php_memory_limit:
process_whole_template: false
output_compression: false
max_upload_size: 12000000
default_upload_permission: 664
url_rewriting: none
page_extension:
query_var: page
image_manipulation_prog: GD
auto_alias_content: true
locale:
default_encoding: utf-8
admin_encoding: utf-8
set_names: true


Php Information:

phpversion: 5.2.10
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 0
memory_limit: 48M
max_execution_time: 30
output_buffering: On
safe_mode: Off (False)
file_uploads: On (True)
post_max_size: 8M
upload_max_filesize: 12M
session_save_path: /tmp (1777)
session_use_cookies: On (True)
xml_function: On (True)


Server Information:

Server Api: apache2handler
Server Db Type: MySQL (mysql)
Server Db Version: 5.0.96


----------------------------------------------