Image display in record view?

A place for users and developers of the Xataface to discuss and receive support.

Postby Aahz » Sat Jun 30, 2007 2:25 am

When looking at Details>View there's a large box with a question mark in it on the left hand side. The tooltip (and file name) are "Missing Logo".

Is there any way to have that box replaced with an image from the record being viewed?

If not, is there any way to get rid of that box altogether?

Thanks for a great program!

-Aahz
Aahz
 
Posts: 17
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Sat Jun 30, 2007 10:06 am

Yes and yes. If you have an image stored in one of the fields of the record it should automatically show up there. If it isn't showing up it is probably because you aren't storing the mimetype of the field. If you are using a blob or container field then you can store the mimetype by adding a field named %fieldname%_mimetype where %fieldname% is the name of the blob/container field.

Alternatively you can mark a field as a logo by adding logo=1 to the fields.ini file section for that field.

If you want to disable the logos from showing up in your application, you can set the 'hide_record_view_logo' preference setting to 1.

e.g.
in the conf.ini file in the [_prefs] section add
hide_record_view_logo=1

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Aahz » Sat Jun 30, 2007 2:23 pm

Thanks Steve! As someone who's barely used PHP and NEVER used SQL or relational databses before, your ap is a godsend. But since there was a recent thread about the docs being "obtuse" I thought I'd mention the following which, while criticism, is entirely intended as constructive criticism:

Your advice was enough for me to get the job done, but it wasn't very clear to a newbie such as myself. Here's the process I went through:

1) read the message

2) Add logo-1 to my fields.ini
This got rid of the big box, but left "click here to see image" dialogue (or something similar) in its place.

3) read the message

4) create pic_mimetype (fretting over Type, etc)

5) edit first record, reloading image
Got error that mimetype must be filled in, but there was no entry spot for mimetype.

6) read the message

7) Google mimetype to learn more

8) search dataface site for mimetype

9) read the message

10) edit SQL to allow pic_mimetype to allow NULL value, set default to jpeg

11) edit first record, reloading image

12) cheer my success!

I got the job done (and learned a few things along the way) but it was still pretty frustrating as I only understood about 60% of your message before I did more research.

I do love Dataface, though and thatyou're so accesible and willing to help us all out with a free app!

Keep up the great work! I'll probably be back soon with another stumbling block, but at least I know there's someone "on the other end of the line" :)

-Aahz
Aahz
 
Posts: 17
Joined: Wed Dec 31, 1969 5:00 pm

Postby ADobkin » Thu Oct 25, 2007 9:57 pm

I've tried using the hide_record_view_logo in my app, and it does work, but it still leaves a large block of whitespace in its place almost the same size that the logo was. Do I need to edit/create a template to remove this also?

What I would really like to do is display the logo when there is an image uploaded, but otherwise I would prefer not to see the question mark or the blank space. If that is not possible/easy to do, then I would like to display the logo for some tables, but not for others. I tried putting the hide_record_view_logo into a getPreferences() function for one of my table delegate classes, but that was ignored. Is there a better way to accomplish this?

Thanks,
Alan
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA

Postby ADobkin » Thu Oct 25, 2007 10:50 pm

It looks like the spacing is defined in plone.css:

.dataface-sections-main {
margin-left: 235px;

}

Do I need to edit the css directly to remove this block and the associated whitespace? Is it possible to do this on a per-table basis?

Thanks,
Alan
ADobkin
 
Posts: 195
Joined: Mon Oct 22, 2007 7:31 pm
Location: Atlanta, GA, USA


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 15 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved