CGBlog image file not showing [solved]

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

CGBlog image file not showing [solved]

Post by howey »

Hi

Any help advice appreciated.

I have installed CGBlog, and added extra fields, one of which is an image field. I have used the default sample detail template, but this doesn't show the image field. It is almost as if the field type, file, isn't working. The image value is shown in the list of extra fields with it's field name. (I did a test and hadn't altered the template at all)

So, I created a template and used this code instead of the default:

Code: Select all

{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}

        {if $field->name == 'Picture'}
          <img src="uploads/cgblog/id{$entry->id}/{$field->value}"/>
        {/if}

  {/foreach}
{/if}
and this worked.

I'm running the latest CMSMS 1.11.7 “Genovesa” with all modules up-to-date:

CGBlog 1.9.12
CGExtensions 1.35
CGSimpleSmarty 1.6.2
CGSmartImage 1.10.10
CMSMailer 5.2.1
CMSPrinting 1.0.4
FileManager 1.4.3
FormBuilder 0.7.3
MenuManager 1.8.5
MicroTiny 1.2.5
ModuleManager 1.5.5
News 2.12.12
Search 1.7.8
ThemeManager 1.1.8

Current PHP Version 5.3.2
everything is ticked apart from E_Deprecated, which is enabled.

Running on a local MAMP solution.

Thanks for any help.

PS. When I click on the module in the admin, everything seems fine. But when I try and navigate to a separate section it seems to freeze. I have given the module a friendly name of "Case Studies"

PPS: I have changed the options to:
URL template to just
{$title}
and
Prefix to use on all URLs to "case_studies"

Although I am not using pretty urls at this moment
Last edited by howey on Sun Jun 23, 2013 2:09 pm, edited 1 time in total.
User avatar
polodesign
Forum Members
Forum Members
Posts: 55
Joined: Sun Jan 03, 2010 1:58 am

Re: CGBlog image file not showing

Post by polodesign »

Hi Howey,

I found the same problem today with the blog image. Change

Code: Select all

{if $field->type == 'file'}
to

Code: Select all

{if $field->type == 'image'}
and the image will then show up.

Your solution works well for calling a single image field, particularly when you have more than one image field.

You can also try this, which doesn't require the 'if isset' or the foreach call:

Code: Select all

{if $entry->fields.yourfieldname}
Have you been able to solve your other issue? I've never had a problem with changing the friendly name. Did you try switching back to the default to see if that is causing the freezing problem?

Cheers,
Penny
howey
Forum Members
Forum Members
Posts: 158
Joined: Fri Sep 14, 2007 1:05 pm

Re: CGBlog image file not showing

Post by howey »

Hi

Thanks, I'll try the =='image' and fieldname solutions. A little neater than my solution.

I changed the friendly name back to default but I am still getting some odd behaviour. When in CGBlog and I click on a link/section outside the immediate "content" section ie "layout" nothing happens, but if I click another section within the "content" section ie "pages" the link works and I can then nav to any other section. This also works if I click on any link outside the immediate menu ie "home". This only happens in the admin theme oneeleven, not in NCleanGrey!

Is this post solved? I'm not sure, I have work arounds in place, but the core functionality is still a little adrift.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGBlog image file not showing

Post by Rolf »

You can call the field direct with something like

Code: Select all

{$entry->fieldsbyname.your_field_name->value}
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
User avatar
polodesign
Forum Members
Forum Members
Posts: 55
Joined: Sun Jan 03, 2010 1:58 am

Re: CGBlog image file not showing

Post by polodesign »

Howey, I wonder if your 'freezing' problem might be with jQuery in the admin area, which is used by the OneEleven theme. I have a similar problem with one of my clients who is hosted elsewhere and I assume that jQuery is the cause (although I have not checked with the host); I just keep their admin in the NCleanGrey theme. You might check with the host to see if that's the case and whether they can change it.

I'd be interested to know if anyone else has experienced this.

cheers,
Penny
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: CGBlog image file not showing

Post by paulbaker »

howey wrote:When in CGBlog and I click on a link/section outside the immediate "content" section ie "layout" nothing happens
This happens with my hosting when I set up a new site. I get support to whitelist the mod_security rule 950004 and all is well. Might be worth a try in your case. Might help you too, Penny?
User avatar
polodesign
Forum Members
Forum Members
Posts: 55
Joined: Sun Jan 03, 2010 1:58 am

Re: CGBlog image file not showing

Post by polodesign »

Thanks Paul - I'll check into that.
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: CGBlog image file not showing

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
Post Reply

Return to “Modules/Add-Ons”