Formatting Buttons
Posted: 21 February 2011 01:48 AM   [ Ignore ]
Wallflower
Rank
Total Posts:  17
Joined  2011-02-04

I’ve been trying to resolve the issue of the formatting buttons not appearing on the form.  I’ve scaled back and done a test with just the custom field form, and stripped all other JavaScript.  I’ve also made sure it was from the main site, in case there might be a path issue to the main themes folder.  The Playa and PT Pill fields are displaying properly so it is clear that the paths to the CSS and other JavaScript files are working as they should.

No luck with anything I’ve tried.

Here’s the build detail if this helps:
ExpressionEngine:  2.1.3 Build 20101220
Safecracker 1.0.3

The text “| Formating Buttons Go Here” appears before every field, but no buttons.  Here’s the template:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<
html >

<
head>

<
meta http-equiv="Content-Type" content="text/html; charset={charset}" />

<
link rel='stylesheet' type='text/css' media='all' href='{stylesheet=shared/trw_css}' />
<
style type='text/css' media='screen'>@import "{stylesheet=shared/trw_css}";</style>

</
head>
<
body>

<
div id="masthead">
    <
a href="{path=site_index}"></a>{embed=shared/rightnav}
</div>


<
div id="wrapper">

    
{embed=shared/pagesetup}

<div id="cleardivs"></div>

{exp:safecracker channel="services" return="services-old/services_test/ENTRY_ID" entry_id="{segment_3}"}

{custom_fields}

    
<p><label for="{field_name}">{if required}{/if}{field_label}</label></p>
    
    <
p>{field_instructions}</p>
    
    <
p>{formatting_buttons}Formating Buttons Go Here</p>

    
{if error}
    
<class="error">{error}</p>
    
{/if}

    {if textarea}
    
<p>    
        <
textarea id="{field_name}" name="{field_name}" dir="{text_direction}" rows="{rows}">{field_data}</textarea></p>
    
{/if}
    
    {if text}
        
<input type="text" dir="{text_direction}" id="{field_name}" name="{field_name}" value="{field_data}" maxlength="{maxlength}" size="50" />
    
{/if}
    
    {if select}
        
<select id="{field_name}" name="{field_name}">
        
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
        
</select>
    
{/if}
    
    {if date}
        
<input type="text" id="{field_name}" name="{field_name}" value="{field_data}" size="50" />
    
{/if}
    
    {if checkbox}
        
</p>{options}<label class="checkbox">{option_value} <input type="checkbox" id="{field_name}" name="{field_name}[]" value="{option_value}"{checked} /></label><br />
    
{/options}
    {
/if}
    
    {if radio}
        
<p>{options}<label class="checkbox">{option_value}<label class="checkbox"> <input type="radio" id="{field_name}" name="{field_name}" value="{option_value}"{checked} /></label><br />
    
{/options}</p>
    
{/if}
    
    {if file}
        
<p>{display_field}</p>
    
{/if}
    
    {if safecracker_file}
        
<p>{display_field}</p>
    
{/if}
    
    {if relationship}
        
<p><select id="{field_name}" name="{field_name}">
        
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
        
</select></p>
    
{/if}
    
    {if multiselect}
        
<p><select id="{field_name}" name="{field_name}[]" multiple="multiple">
        
{options}<option value="{option_value}"{selected}>{option_name}</option>{/options}
        
</select></p>
    
{/if}

    {if playa}
        
<p>{display_field}</p>
    
{/if}

    {if pt_pill}
        
<p>{display_field}</p>
    
{/if}

    {if pt_dropdown}
        
<p>{display_field}</p>
    
{/if}

{
/custom_fields}

{
/exp:safecracker}

</div>


</
body>
</
html
Profile
 
 
Posted: 21 February 2011 10:21 PM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Have you double checked your textarea field settings to make sure Show Formatting Buttons is set to yes? Also you’ll need the saef css to ensure the buttons display properly:

<link href="{path=css/_ee_saef_css}" type="text/css" rel="stylesheet" media="screen" /> 

You might also want to wrap in a conditional for those fields that don’t have formatting buttons:

{if formatting_buttons}
    
<p>{formatting_buttons}Formating Buttons Go Here</p>
    
{/if} 
Profile
 
 
Posted: 21 February 2011 11:34 PM   [ Ignore ]   [ # 2 ]
Wallflower
Rank
Total Posts:  17
Joined  2011-02-04

Progress, but still not there yet.  I added the saef css link and verified that the textarea fields had formatting buttons turned on. There is now a gray bar where the formatting buttons should be.  I’ve tried it with only the saef stylesheet, to eliminate the possibility that something in ours is trumping it, but that wasn’t it.

Anything else to suggest?

I’ve attached a screen print so you can see what I see now.

Profile
 
 
Posted: 21 February 2011 11:35 PM   [ Ignore ]   [ # 3 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Do the formatting buttons show up properly in the CP edit screen?

Profile
 
 
Posted: 21 February 2011 11:39 PM   [ Ignore ]   [ # 4 ]
Wallflower
Rank
Total Posts:  17
Joined  2011-02-04

Yup.

Profile
 
 
Posted: 21 February 2011 11:42 PM   [ Ignore ]   [ # 5 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Is this at a URL I can see? If so, you can PM it to me.

Profile
 
 
Posted: 22 February 2011 02:39 AM   [ Ignore ]   [ # 6 ]
Wallflower
Rank
Total Posts:  17
Joined  2011-02-04

I’ve PM’d you.

Profile
 
 
Posted: 22 February 2011 12:31 PM   [ Ignore ]   [ # 7 ]
Wallflower
Rank
Total Posts:  17
Joined  2011-02-04

Rob,

Thanks again for your help.

I’ve taken it to the next step and that is to test it at one of the third level domain sites.  The buttons aren’t working again (at all), although the only thing I changed was the channel.  I’m back to no button.

I coped the saef template into the templates on this MSM site too and the image page is the full url so it can’t be that.

Is there something we need to do in the safecracker template to make sure it knows where the CP JavaScript is?  I would assume that is something taken care of by EE, but at this point I’m not assuming anything.

Profile
 
 
Posted: 22 February 2011 07:04 PM   [ Ignore ]   [ # 8 ]
Wallflower
Rank
Total Posts:  17
Joined  2011-02-04

Since I posted the above, I’ve gotten everything except the formatting buttons to work.  The button space is there, but the images are not.  The textarea fields expand, so I know the path to the CP JavaScript is working properly.  I tried adding a copy of the images to the third level domain’s folder, and changing the link in the SAEF, but that didn’t fix it either.

http://my.resumeworks.biz/index.php/qform/test

Profile
 
 
Posted: 01 March 2011 12:40 PM   [ Ignore ]   [ # 9 ]
Wallflower
Rank
Total Posts:  17
Joined  2011-02-04

I finally got this to work on the second site on this multiple site manager site.  I’ll post a follow-up to save others a week’s worth of hair loss if they should have a similar issue.

I, obviously, didn’t get the memo when I upgraded to EE 2.x that described the new Admin -> Content Administration -> Default HTML Buttons settings.  When I checked that I had formatting buttons in the Control Panel, I didn’t think I needed to check across all the sites for the installation, but I needed to, because the other sites were blank.  That’s not your fault.  You asked me if I could see formatting buttons, and I answered you.  I had HTML buttons ONLY for the main site (where the system files are installed), because the conversion created buttons for that site ONLY.  (So much for there not being a “main” site in a multiple site manager site.)

Once I set the defaults for the other site, that didn’t resolve the problem, however.  Only new users get the new defaults.  Existing users get whatever they had when the site was converted to Version 2.x, which in my case was nothing.  Nothing is what I inherited, so my user profile would be nothing until I manually added buttons (and it would be true for any other user who inherited nothing, which is every other existing user), so until I added buttons to my profile, I still couldn’t see any buttons.

Needless to say, this was a layer upon layer of issues, so if I may, I’ll recap for others what to check for if they encounter the “No Formatting Buttons” problem:

1.  Make sure the basics of the form are set up (which has been outlined elsewhere on the forums).

2.  Link to the saef.css. (It is located at: ./themes/cp_themes/default/css/)  If you prefer to put a copy in your templates, be sure to update the links to the image folder (such as: ./themes/cp_themes/default/css/images). Otherwise you’ll be terribly embarrassed when one of the guys here points that out to you!

3.  Use the {formatting_buttons} tag within the {custom_fields} tag pair.  (Formatting buttons cannot be displayed on forms that are custom designed, i.e, forms that do not use the custom fields tag pair.)

4.  Make sure you can see the formatting buttons in the Control Panel, if you do not see them, check the following, if you do see them, go to step 5:
      a. If you cannot see buttons in the Control Panel, check to see if there are default buttons set up for the site at Admin -> Content Administration -> Default HTML Buttons. Each site (of a MSM) has default formatting buttons, and each user can have different settings (they may have inherited nothing in a conversion from 1.x to 2.x, may have had something before conversion that got converted, or may choose to override them later if they have CP/Account access). You need to check on EVERY site of a multiple site manager site.  If the site has default buttons, but you do not see them on the Control Panel publish page, verify that you see them in your account settings (My Account -> HTML Formatting Buttons).
      b. Each field can have the formatting buttons set to on or off.  Check the settings for each field in the custom field settings.

5.  If you have verified that you can see buttons in the Control Panel publish page, and all of the above, and still can’t see the formatting buttons in your form, then you can start pulling your hair out, and post a help request.

[ Edited: 01 March 2011 09:30 PM by Connie ]
Profile