Page 1 of 1
Need help getting images to show in CGBlog
Posted: Tue Dec 23, 2014 9:30 pm
by seenoequal
Im currently working on a new look for my website. I have my results template layed out the way i want it, but i cant seem to get images to show.
To add a bit more detail, I am using cgblog to host music downloads from my site, these downloads all have associated images.
In cg blog i added a field definition and named it cover, this is where i upload the images.
In my cgblog template i use the following code to place my image
Code: Select all
<img src="{$entry->file_location}/{$entry->cover}" alt="Artwork"/>
from what ive worked out
calls the dir. path of my image and
calls the file name.
This works for me in cgblog.
However Id like my images to also show in my search results but the tags i was using work only in relation to the cgblog module.
at this point it may be worth mentioning that i have set my search to only pick up results from cgblog
so my question is, is there a way to make my search results pick up entries from other modules (cgblog)?
I am using CMS MADE SIMPLE 1.10.3 "Hyacinthe"
I hope ive added enough info to bring up a solution.
Re: Need help getting images to show in CGBlog
Posted: Wed Dec 24, 2014 5:54 am
by staartmees
First tip: update your cmsms asap to avoid security problems. Normally your version is no longer supported,
http://forum.cmsmadesimple.org/viewtopi ... 40&t=30336
Re: Need help getting images to show in CGBlog
Posted: Wed Dec 24, 2014 10:57 am
by seenoequal
Ok will do that sometime today, one thing I'm worried about is losing my things stored in cmsms modules, such as my articles etc, I have done a ftp backup but what about the rest? Will all of that stuff still be there after I upgrade?
Re: Need help getting images to show in CGBlog
Posted: Thu Dec 25, 2014 8:24 am
by staartmees
Always make a backup of your database before a major upgrade,
http://docs.cmsmadesimple.org/upgrading ... nformation
Re: Need help getting images to show in CGBlog
Posted: Sat Jan 03, 2015 2:57 pm
by seenoequal
working on the upgrade situation, in the meantime are there any answers to my original problem?
Re: Need help getting images to show in CGBlog
Posted: Wed Jan 07, 2015 9:29 am
by Jeff
seenoequal wrote:
at this point it may be worth mentioning that i have set my search to only pick up results from cgblog
so my question is, is there a way to make my search results pick up entries from other modules (cgblog)?
Those two statements seem contradictory, if you want other modules then undo what you set to only pick up result from cgblog...more than likely I don't understand your question or problem. It might be helpful to provide a link to your site and include the templates that you are having problems with.
Re: Need help getting images to show in CGBlog
Posted: Sat Jan 10, 2015 9:35 pm
by seenoequal
@ Jeff, what i meant by that was id like for my search module to recognize the tag used for my images in the 'other module' cgblog..
to clarify..
I am using this tag to find my uploaded images in my cgblog module..
Code: Select all
<img src="{$entry->file_location}/{$entry->cover}" alt="Artwork" class="size-3-4"/>
What im trying to achieve is for
Code: Select all
{$entry->file_location}/{$entry->cover}
from my cgblog module to be available as a parameter to use in my search results
Re: Need help getting images to show in CGBlog
Posted: Sun Jan 11, 2015 6:33 pm
by pete290
You should install CGSmartimage and use something like this
{CGSmartImage src="{$entry->file_location}/{$entry->fieldsbyname.postimg->value}" filter_watermark=1 filter_croptofit="218,176,tc" class="prod_img"}
Re: Need help getting images to show in CGBlog
Posted: Mon Jan 12, 2015 11:03 am
by rotezecke
these variables are not set. see for yourself. add this to your search template:
Code: Select all
{if $entry->module == "CGBlog"}
{$entry|print_r}
{/if}
returns (in my case):
so you need to create a simple detail template that shows the image (or more). then, inside your search result template's foreach loop, you need something like this:
Code: Select all
{if $entry->module == "CGBlog"}
{CGBlog articleid=$entry->modulerecord detailtemplate="the-image-only-template-you-just-made"}
{/if}
Re: Need help getting images to show in CGBlog
Posted: Mon Jan 12, 2015 12:23 pm
by velden
pete290 wrote:You should install CGSmartimage and use something like this
{CGSmartImage src="{$entry->file_location}/{$entry->fieldsbyname.postimg->value}" filter_watermark=1 filter_croptofit="218,176,tc" class="prod_img"}
Though above code is not wrong, you might want to look at the help and read about the src1 and src2 parameter
Code: Select all
{CGSmartImage src1=$entry->file_location src2=$entry->fieldsbyname.postimg->value filter_watermark=1 filter_croptofit="218,176,tc" class="prod_img"}
Re: Need help getting images to show in CGBlog
Posted: Tue Jan 13, 2015 6:13 pm
by seenoequal
neither of those are working for me, it might be a good point to mention that my search entries all have open graph meta data which selects the right image for facebook etc,
maybe i could pull the meta image into my search results template. Is this possible if so anybody know how?
Though above code is not wrong, you might want to look at the help and read about the src1 and src2 parameter
Code:
{CGSmartImage src1=$entry->file_location src2=$entry->fieldsbyname.postimg->value filter_watermark=1 filter_croptofit="218,176,tc" class="prod_img"}
cgsmart image is new to me, all its doing when i add this tag is removing the css and leaving my page looking very plain. Can you elaborate on how this module calls my custom fields from cgblog?
Re: Need help getting images to show in CGBlog
Posted: Tue Jan 13, 2015 6:27 pm
by seenoequal