add parameters to Image preview (IMG tag) in the edit form

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

add parameters to Image preview (IMG tag) in the edit form

Postby neotrode » Wed Jan 11, 2012 10:40 am

What function can I use in the Delegate class to replace or revise the output of the Wrapper/Preview of an image? I want to add a class or ID parameter to the IMG tag so that Jquery interprets it.

I tried these two possibilities to no avail...

Code: Select all
function NL_photo__renderCell( &$record ) {
   return "<img id=\"jcrop_image\" src=\"http://".$_SERVER['SERVER_NAME']."/images/article/".$record->strval('NL_photo')."\" width=130>";
}

and...

function NL_photo__htmlValue(&$record){

   return "<img id=\"jcrop_image\" src=\"http://".$_SERVER['SERVER_NAME']."/images/article/".$record->strval('NL_photo')."\" width=130>";
}


Thanks,
Frank
neotrode
 
Posts: 26
Joined: Mon Dec 20, 2010 11:08 am

Re: add parameters to Image preview (IMG tag) in the edit fo

Postby shannah » Wed Jan 11, 2012 2:02 pm

Unfortunately these previews are currently just hard coded in the Dataface_QuickForm_element.html template (in the Dataface/templates directory).

This should really be remedied but for now you'll need to override this template. (e.g. you could copy this into your own templates directory and make changes accordingly to make it work for you).

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: add parameters to Image preview (IMG tag) in the edit fo

Postby neotrode » Thu Jan 12, 2012 12:04 pm

Ah...found it. Unfortunately, like you said, I have to hard code it in but at least it is in the overridden template. It is named: Dataface_Form_Section_Template.html

For those wondering why to use this... This inquiry was in reference to the following other post:
http://www.xataface.com/forum/viewtopic.php?f=4&t=6537
I also explain how I integrated the JQuery JCrop tool to an image uploaded in the table.

Best,
Frank
neotrode
 
Posts: 26
Joined: Mon Dec 20, 2010 11:08 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 10 guests

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