How to {display_field} + {field_data} with DM EECK?
Posted: 22 February 2011 04:47 AM   [ Ignore ]
Wallflower
Rank
Total Posts:  16
Joined  2010-10-13

Hi guys,

I’m very new to SC. Hopefully this is a quick question…

How do I display the field data for a custom field (DM EECK) when editing the SC form?

Inside a {custom_fields} loop, I have:

{if dm_eeck}
    
    {display_field}
    
    {field_data}
        
    {
/if} 

I’m getting the custom field showing with the data, then a duplication of the data. However, if I remove {display_field}, I get just the data (not inside the custom field [which is CK Editor]). If I remove {field_data}, I get a standard textarea with the data inside.

See screenshot.

(FYI, I cut and pasted some HTML from the SC guide as a test—that’s what you’re seeing in the rendered data)

What’s the proper syntax for displaying custom field data IN the custom field?

Profile
 
 
Posted: 22 February 2011 05:07 AM   [ Ignore ]   [ # 1 ]
Wallflower
Rank
Total Posts:  16
Joined  2010-10-13

Ok, this may be a false alarm.

I displayed the field with {field:your_custom_field_name} instead. It still initially broke, so I changed the content that was pasted in the field. Now it works… I guess something in there was breaking it…

For now, it seems to be working!

My issue is solved.

Profile
 
 
Posted: 22 February 2011 05:18 AM   [ Ignore ]   [ # 2 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29
{if dm_eeck}
    
    {display_field}
        
    {
/if} 

Is the right syntax. Not sure why it’s not working for that fieldtype, haven’t tested that one I think.

Profile
 
 
Posted: 22 February 2011 06:17 AM   [ Ignore ]   [ # 3 ]
Wallflower
Rank
Total Posts:  16
Joined  2010-10-13

Hi Rob,

EECKEditor is on the list of tested add-ons.

I think I may have something for you…

I was trying to get jQuery AJAXForm working, and encountered a mysterious error with the generated Safecracker form code. I think it could be related to this problem too.

The line in question is this script inclusion, at the end of the generated Safecracker form:

<s.c.r.i.p.t type="text/javascript" charset="utf-8" src="http://domain.com/?ACT=66&ui=core,widget,mouse,position,draggable,resizable,button,dialog,datepicker&plugin=scrollable,scrollable.navigator,ee_filebrowser,markitup,thickbox&v=1292882774&use_live_url=y&include_jquery=y"></s.c.r.i.p.t

(.‘s added by me, as the forum was removing the code)

I’m getting the following error when I try to load that script URL:

The URI you submitted has disallowed characters

A google search reveals this thread: http://davidmichaelthompson.com/2009/09/03/fixed-the-uri-you-submitted-has-disallowed-characters-error-codeigniter/

Upon inspecting CI URI.php, it looks like EL has addressed this issue (minus is being escaped) since this was written—however, it does seem like the URI is the culprit. The script is unable to load because the URI is inaccessible, and jQuery is breaking. 

Any idea what’s causing this and how to fix?

[ Edited: 22 February 2011 06:19 AM by Graham H ]
Profile
 
 
Posted: 22 February 2011 06:27 AM   [ Ignore ]   [ # 4 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

That probably happened when you copy/pasted the URL, which includes & amp ; (spaces are mine) instead of just a plain &. The script actually loads fine, since your browser will convert the & amp ; before making the request. When you type that directly, though, it will trigger that error in EE. The TRUE test of whether or not it’s loading properly is to check your browser’s error console for Javascript and/or 404 errors.

Profile
 
 
Posted: 22 February 2011 06:53 AM   [ Ignore ]   [ # 5 ]
Wallflower
Rank
Total Posts:  16
Joined  2010-10-13

Hmm, good point.

I checked the console and the script does appear to be loading. However, ajaxForm is throwing out an error:

Uncaught TypeErrorObject #<an Object> has no method 'ajaxForm' 

When I remove the Safecracker form, ajaxForm works as expected.

To try and narrow it down, I hardcoded the Safecracker code—likely generating the & issue you note above in the process.

Any other suggestions for how I can narrow down what’s causing the break?

Profile
 
 
Posted: 22 February 2011 06:55 AM   [ Ignore ]   [ # 6 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Where are you loading the ajaxForm plugin and where are you binding it to the form?

Profile
 
 
Posted: 22 February 2011 07:14 AM   [ Ignore ]   [ # 7 ]
Wallflower
Rank
Total Posts:  16
Joined  2010-10-13

I’ll PM you a link.

Profile
 
 
Posted: 23 February 2011 08:52 PM   [ Ignore ]   [ # 8 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Here’s what’s happening. You’re loading jQuery in your head, then the Form plugin. Later on, in the body, SC loads jQuery again, which overwrites the loaded Form plugin. The solution is to not include your own jQuery in the head, and place the Form plugin + your code to load it after the closing safecracker tag.

Profile
 
 
Posted: 25 February 2011 09:33 PM   [ Ignore ]   [ # 9 ]
Wallflower
Rank
Total Posts:  16
Joined  2010-10-13

Shazam.

Rob, you are my hero.

Congrats on the EL acquisition. Although I just bought SC a few days ago, I won’t request a refund.

You guys deserve it. 

Thanks again.

Profile