[solved] CGBlog Additional Fields file_location?

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

[solved] CGBlog Additional Fields file_location?

Post by rbaby »

I added an additional field to CGBlog for just an image upload but when I upload it...I can't find the actual file.

All that appears is a broken image with the path as /filename.jpg so it doesn't appear to be finding the file_location and actually uploading the file. Is there a configuration setting I am missing somewhere?

Thank you in advance.
Last edited by rbaby on Mon Jun 15, 2015 7:02 am, edited 1 time in total.
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: CGBlog Additional Fields file_location?

Post by Jeff »

I have you verified if the images is uploaded?

check the default template, cg usually has a $entry->file_location variable that is suppose to be in front field call.
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: CGBlog Additional Fields file_location?

Post by rbaby »

Jeff wrote:I have you verified if the images is uploaded?

check the default template, cg usually has a $entry->file_location variable that is suppose to be in front field call.
Hi Jeff,

The file can't be found anywhere, not in root, not in uploads/images. This is what I have in my template that's showing the broken image:

Code: Select all

{if isset($entry->fields)}
  {foreach from=$entry->fields item='field'}
     <div class="CGBlogSummaryField">
        {if $field->type == 'file'}
          <img src="{$entry->file_location}/{$field->value}"/>
        {else}
          <img src="{$entry->file_location}/{$field->value}"/>{$field->name}:&nbsp;{eval var=$field->value}
        {/if}
     </div>
  {/foreach}
{/if}
I also tried:

Code: Select all

{if !empty($entry->fieldsbyname.Image->value)}
<a href="{$entry->detail_url}"><img src="{$entry->file_location}/{$entry->fieldsbyname.Image->value}" width=100px /></a>
{/if}
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm

Re: CGBlog Additional Fields file_location?

Post by Jeff »

Paste the contents of <pre>{$entry|@print_r}</pre>

The files are typically uploaded to /uploads/cgblog/cgblog_{$cgblog_id}/ or something like that.

Can you post the url?
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: CGBlog Additional Fields file_location?

Post by rbaby »

Jeff wrote:Paste the contents of <pre>{$entry|@print_r}</pre>

The files are typically uploaded to /uploads/cgblog/cgblog_{$cgblog_id}/ or something like that.

Can you post the url?

Code: Select all

stdClass Object
(
    [author] => author
    [id] => 1
    [title] => Test Blog Entry
    [content] => 
This is blog content.


    [summary] => 
    [postdate] => 2015-06-06 13:24:00
    [url] => 
    [startdate] => 2015-06-06 13:24:00
    [enddate] => 
    [create_date] => 2015-06-06 13:25:07
    [modified_date] => 2015-06-06 16:17:02
    [categories] => Array
        (
            [0] => Array
                (
                    [id] => 1
                    [name] => General
                )

            [1] => Array
                (
                    [id] => 2
                    [name] => Training
                )

            [2] => Array
                (
                    [id] => 3
                    [name] => In The Peloton
                )

            [3] => Array
                (
                    [id] => 4
                    [name] => Cross Train
                )

        )

    [categorylist] => Array
        (
            [0] => 1
            [1] => 2
            [2] => 3
            [3] => 4
        )

    [fields] => Array
        (
            [Image] => stdClass Object
                (
                    [name] => Image
                    [type] => image
                    [value] => blog.jpg
                )

        )

    [fieldsbyname] => Array
        (
            [Image] => stdClass Object
                (
                    [name] => Image
                    [type] => image
                    [value] => blog.jpg
                )

        )

    [detail_url] => http://www.domain.com/cyclesense365/1/Test-Blog-Entry
)
1
I found the image blog.jpg, it was in the directory you mentioned--but why isn't it displaying the image with the proper path?
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: CGBlog Additional Fields file_location?

Post by rbaby »

Jeff wrote:Paste the contents of <pre>{$entry|@print_r}</pre>

The files are typically uploaded to /uploads/cgblog/cgblog_{$cgblog_id}/ or something like that.

Can you post the url?
Is there a way I can just hard code the path? I just don't know how to pass the blog ID for the folder ID.
rbaby
Forum Members
Forum Members
Posts: 144
Joined: Thu Feb 07, 2008 10:28 pm

Re: CGBlog Additional Fields file_location?

Post by rbaby »

For those who might be running into the same issue, I found a solution here: http://dev.cmsmadesimple.org/bug/view/9933

<img src="{uploads_url}/cgblog/id{$entry->id}/{$field->value}"/>
Post Reply

Return to “Modules/Add-Ons”