Default imgae in fileupload element not showing??

OK, I've run some tests locally, I think I know what may be happening.

Before I do anything on your site - can you confirm that the site currently in your My Sites for caps-mc is the test site? Also, that the ftp info is for that site? Better yet, can you install exTplorer in the test site, and I'll use that for editing the file I need to test? And, just to be 100% sure, put a foo.html file at the top level of the front end, that just says "test site" or some such?

I really want to make 100% sure I'm working on the right one!!

-- hugh
 
Ok - I'll wait for your findings. How will you then communicate them, as I do not beleive I get any notifations from this thread, when my memebership has run out..
 
Did you see my request above for definite confirmation that the URL in your My SItes for Caps is the tests site?

Also, if you want to find me on Skype ('cheesegrits', hugh dot messenger at gmail dot com), we can continue there if we don't get this done before you sub expires. I only use it for IM'ing, not voip, so just send a contact request, and remember to mention Fabrik, or give some indication of who you are (I get a lot of spam contact requests).

-- hugh
 
As per our Skype conversation:

The problem with this was that your custom template is using the _raw row data (like $this->_row->data->yourtable___yourupload_raw) to build an IMG tag. And we don't set the _raw for empty upload elements with the default image, we only put that in the "non raw" data. Because the "raw" data represents what comes out of the database, and there is nothing in the database when the default image is being used.

I think your assumption was that when nothing is uploaded, we would write the default image out to the database for that element. But we don't. We simply check when rendering the element, and if it's empty, we use the default image.

The reason we don't write the default image out to the table is, it is more flexible that way. For example, if you decided to change the default image, if we wrote it out to the table, you'd be stuck having to replace all the instances of the default image in your already uploaded table data. The way we do it, you can change your default image, and it'll automatically get used for all empty data.

A fix would either be to use the non-raw data in your custom template, or if that doesn't have what you want in it, hard code a test in your custom template for the _raw data being empty, and if so, use your default image:

Code:
if (empty($this->_row->data->yourtable___yourupload_raw)) {
   // code to use your empty data image here
}
else {
  // your existing code here
}

... or rather than hard coding it, you could use the non _raw data, as I think that should just be an IMG tag at that point, which I think is what you want.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top