Page 1 of 1

CGblog & Gallery - Loading specific gallery [SOLVED]

Posted: Sun Dec 23, 2012 10:23 pm
by seanus
Hi guys,

I dont usually come hear to ask for help as I generally solve it by searching the forums but I cant seem to find any answers for my issue.

Im using
- Cmsms 1.11.4
- Cgblog 1.9.8
- Gallery 1.6

I had this working correctly before the upgrade to 1.11.

Basically i upload images to a subdirectory using the date of the blog post for instance 22-11-2012

In the summary template for cgblog i use this code

Code: Select all

{if $entry->Blog_Images eq '1'}
{assign var="imagesValue" value=$entry->postdate|date_format:"%d-%m-%Y"}
{Gallery dir=Blog-Images/$imagesValue template=BlogSummary number=1}
{/if}
to get the date of the blog post and apply in to the dir attribute to grab the gallery and show 1 image from that specific gallery.

It wont work now. I just get the folder icon. It applies

I have made sure the {$imagesValue} has data i have also added the normal gallery tags without the variable to see if it works and it does. Both these work perfectly

Code: Select all

{cms_module module='Gallery' dir=Blog-Images/22-11-2012 template='BlogSummary' number='1'}
{Gallery dir='Blog-Images/22-11-2012' template='BlogSummary' number='1'}
Im kind of at my wits end now. Has anyone encountered this issue and know how I can solve it. Im hoping to get this site live in the new year but without this feature it wont get signed off.

View the Problem

Big thanks for a speedy response
Sean


----------------------------------------------
Cms Version: 1.11.4
Installed Modules:
CMSMailer: 5.2.1
CMSPrinting: 1.0.3
FileManager: 1.4.3
MenuManager: 1.8.4
CGSimpleSmarty: 1.5.2
ModuleManager: 1.5.5
News: 2.12.10
Search: 1.7.7
ThemeManager: 1.1.7
CGExtensions: 1.31.2
CGBlog: 1.9.8
CGFeedMaker: 1.0.17
Captcha: 0.4.5
FormBuilder: 0.7.3
Gallery: 1.6
SiteMapMadeSimple: 1.2.6
TinyMCE: 2.9.12
youtubeplayer: 1.3.1

Config Information:
php_memory_limit:
process_whole_template:
output_compression:
max_upload_size: 5000000
url_rewriting: mod_rewrite
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.17-pl0-gentoo
md5_function: On (True)
gd_version: 2
tempnam_function: On (True)
magic_quotes_runtime: Off (False)
E_STRICT: 0
memory_limit: 128M
max_execution_time: 30
output_buffering: 4096
safe_mode: Off (False)
file_uploads: On (True)
post_max_size: 6M
upload_max_filesize: 5M
session_save_path: No check because OS path
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.1.62
Server Db Grants: Could not find a suitable "GRANT ALL" permission. This may mean you could have problems installing or removing modules. Or even adding and deleting items, including pages

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

Re: CGblog & Gallery - Loading specific gallery dir by var

Posted: Mon Dec 24, 2012 9:50 am
by Rolf
Try this:

Code: Select all

{capture assign='imagesValue'}Blog-Images/{$entry->postdate|date_format:'%d-%m-%Y'}{/capture}
{Gallery dir=$imagesValue template='BlogSummary' number=1}
grtz. Rolf

Re: CGblog & Gallery - Loading specific gallery dir by var

Posted: Mon Dec 24, 2012 10:40 am
by seanus
Rolf wrote:Try this:

Code: Select all

{capture assign='imagesValue'}Blog-Images/{$entry->postdate|date_format:'%d-%m-%Y'}{/capture}
{Gallery dir=$imagesValue template='BlogSummary' number=1}
grtz. Rolf
AWESOME! Thanks Rolf!

I was actually coming on to say I had solved it but yours was a much better solution. I was using this.

Code: Select all

{assign var="dateValue" value=$entry->postdate|date_format:"%d-%m-%Y"}
{capture assign='imgDir'}Blog-Images/{$dateValue}{/capture}
Same result not as efficient.

Thanks heaps for your help.