ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SafeCracker & File Manager

August 30, 2012 5:59am

Subscribe [3]
  • #1 / Aug 30, 2012 5:59am

    MadeByShape

    35 posts

    When using Safe Cracker, is File Manager available?

    It seems to pop up fine, load the files fine but I can’t get the upload box to appear or any styling on the file manager.

    I’ve attached a screenshot.

    At first I thought my sites styling was clashing with File Managers but I disabled this and it still doesn’t work.

    Im guessing im missing a CSS / JS file or a link to a resource somewhere.

    If you could point me in the right direction that would be great.

  • #2 / Aug 30, 2012 10:10am

    zizther

    228 posts

    Hi Shape.

    Can you show us the code your using?

  • #3 / Aug 30, 2012 10:42am

    MadeByShape

    35 posts

    For sure,

    FYI - The File Manager is being launched from WYGWAM

    {!--
    <link rel="stylesheet" href="{site_url}themes/cp_themes/default/css/jquery-ui-1.8.16.custom.css?v=1329830369" type="text/css" media="screen" />
    <link rel="stylesheet" href="{site_url}themes/cp_themes/default/css/global.css?v=1329830367" type="text/css" media="screen" />
    --}
          
    <h2 class="mb0">Add / Edit Blogs</h2>
    <div class="box-content alternate-light">
    
     {if segment_3 == ""}
      
      <a href="http://{site_url}index.php/account/blogs/add" title="#" class="btn-ui mb10">Add Blog Post</a>
     
      <table id="global-table">
       <tr>
        <th>Title</th>
        <th>Entry Date</th>
        <th>Status</th>
        <th># Comments</th>
        <th>Preview</th>
       </tr>
       {exp:channel:entries channel="entry_blog" author_id="CURRENT_USER"}
        {if no_results}
         <tr>
          <td colspan="5"><div class="note">Sorry you have no blog entries</div></td>
         </tr>
        {/if}
        <tr>
         <td>
          <a href="http://{site_url}index.php/account/blogs/edit/{url_title}" title="{title}">{title}</a>
         </td>
         <td>{entry_date format="%j%S %F %Y"}</td>
         <td>{status}</td>
         <td>{comment_total}</td>
         <td><a href="http://{site_url}index.php/blogs/experts/{url_title}/1" title="Preview" target="_blank" rel="noopener">(Preview)</a></td>
        </tr>
       {/exp:channel:entries}  
      </table>
      
     {if:elseif segment_3 == "add"}
     
      {exp:safecracker channel="entry_blog" return="account/blogs" class="form-large" allow_comments="yes"}
       <ul>
        <li><label>Title</label><input name="title" type="text"></li>
        <li>{field:cf_news_content}</li>
        <li>
         <label>Category</label>
         <ul class="list-vert">
          {categories}
           <li><input type="checkbox" name="category[]" value="{category_id}"{if {category_id} == "26"} checked disabled{/if}{selected}> {category_name}</li>
          {/categories}
         </ul>
        </li>
        <li><input type="submit" value="Submit" class="button"></li>
       </ul>
      {/exp:safecracker}
     
     {if:elseif segment_3 == "edit"}
     
      {exp:safecracker channel="entry_blog" return="account/blogs" class="form-large" url_title="{segment_4}" allow_comments="yes"}
       <ul>
        <li><label>Title</label><input name="title" type="text" value="{title}"></li>
        <li>{field:cf_news_content}</li>
        <li>
         <label>Category</label>
         <ul class="list-vert">
          {categories}
           <li><input type="checkbox" name="category[]" value="{category_id}"{if {category_id} == "26"} checked disabled{if:else} {checked}{/if}> {category_name}</li>
          {/categories}
         </ul>
        </li>
        <li><input type="submit" value="Submit" class="button"></li>
       </ul>
      {/exp:safecracker}
     
     {/if}
     
    </div>

    If I uncomment the two CSS files at the top I get it to partially work. But the file upload box doesn’t appear. See new screenshot attached.

  • #4 / Aug 30, 2012 5:37pm

    Kevin Smith

    4784 posts

    Hi Shape,

    I know the file manager works just fine using the SafeCracker File field within SafeCracker, but I’m not sure about it being launched within Wygwam. As part of the troubleshooting, I’d suggest working with the Pixel & Tonic folks to troubleshoot this.

    On our end, let’s look at a few things:

    - Are you running the normal CP theme with no modifications or add-ons means to alter to look of the CP?
    - If you look in your JavaScript console on the front-end page you’re having trouble with, do you see any JavaScript errors?

  • #5 / Aug 31, 2012 6:01am

    MadeByShape

    35 posts

    Hi Kevin

    I’ll contact Pixel & Tonic. Could you point me in the direction to your documentation for using file field in SafeCracker? So I can test it this way with just a single image. I might be able to pin point a problem then.

    I checked for JS errors before posting on EEforums, but there was none.

    I disabled the sites theme and only had the EE CP theme enabled and the file open loads fine, but the “upload” box just loads the homepage of the site in to an iFrame? See screenshot on previous post.

  • #6 / Sep 05, 2012 2:35pm

    Dan Decker

    7338 posts

    Hey Shape,

    Could you point me in the direction to your documentation for using file field in SafeCracker?

    The standard File Field doesn’t work with SafeCracker, hence SafeCracker File.

    However, neither of those factor in with Wygwam. It’s your preference if Wygwam loads the default File Manager or CKFinder.

    Let’s get to the root of your needs here.

    You have a SafeCracker template.
    You have a Wygwam field in that channel.
    You also have a SafeCracker File/File Field in the channel - OR -
    You want to use Wygwam to upload directly into the editor - OR -
    Both?

    You are experiencing the inconsistencies in your SafeCracker template or the Control Panel or both?

    Cheers,

  • #7 / Sep 11, 2012 3:33am

    MadeByShape

    35 posts

    Hi Dan

    Yeah I spoke to P&T and they said it wasn’t a problem on their end because all WYGWAM does is fire up the File Manager and doesn’t modify it. So it’s an EE problem.

    He did suggest this though…

    Usually when we see the site homepage get loaded into the CP, it’s because there’s some Ajax request that the CP is making that gets routed through a .htaccess redirect, and in the process, looses its query string (”?ACT=X&...”), so by the time the request actually hits EE, EE has no idea it was intended to reach some internal component, and thinks it’s just a normal site request, hence returning the homepage.

    But yeah… I have a SafeCracker template, a WYGWAM field, but I want to use the file uload button on the WYGWAM bar to load the file manager (Which does work - it’s the the upload part of it that doesn’t)

    I have no problems in the Control Panel, just on the front end (SafeCracker)

    I did suggest to P&T that I’m using a HTTPS connection on the site, but i’ve added the secure parameters SafeCracker suggests also and they don’t do anything neither.

  • #8 / Sep 12, 2012 9:02am

    Dan Decker

    7338 posts

    Hey Shape.

    Given the nature of your set-up, the quickest route to resolution would be to get a look at it.

    Be on the lookout for an email from EllisLab!

    Cheers,

  • #9 / Sep 13, 2012 3:59am

    MadeByShape

    35 posts

    Hi Dan

    I’ve replied to the email 😊 I await your response.

    Can we update this thread with the problem just incase people get similar problems also?

  • #10 / Sep 14, 2012 5:19pm

    Dan Decker

    7338 posts

    Hi Shape,

    Turns out, loading the File Manager is not supported on the front-end.

    The FIle Manager makes a request to the CP libraries that aren’t allowed to be made through the front.

    If you are going to be using Wygwam, you will need to set it to CKFInder.

    Thank you for your patience.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases