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.
[solved] CGBlog Additional Fields file_location?
[solved] CGBlog Additional Fields file_location?
Last edited by rbaby on Mon Jun 15, 2015 7:02 am, edited 1 time in total.
Re: CGBlog Additional Fields file_location?
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.
check the default template, cg usually has a $entry->file_location variable that is suppose to be in front field call.
Re: CGBlog Additional Fields file_location?
Hi Jeff,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.
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}: {eval var=$field->value}
{/if}
</div>
{/foreach}
{/if}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}Re: CGBlog Additional Fields file_location?
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?
The files are typically uploaded to /uploads/cgblog/cgblog_{$cgblog_id}/ or something like that.
Can you post the url?
Re: CGBlog Additional Fields file_location?
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
)
1Re: CGBlog Additional Fields file_location?
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.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?
Re: CGBlog Additional Fields file_location?
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}"/>
<img src="{uploads_url}/cgblog/id{$entry->id}/{$field->value}"/>

