0

Am using the following code for channel images field to be displayed on the frontend using channel form tag.

<label for="ad_uploads">Upload your images</label>
{field:ad_uploads}

However, it doesn't work!

Any suggestions?

Am using ee 2.11.3 and Channel images 6.0.2

0

If this is still actual, please choose the variant which is best matched to your needs:

1) switch on the Channel form (or Safecracker form) "include_assets" and "include_jquery" parameters:

{exp:channel:form
  channel="some_channel"
  ...
  include_assets="yes"
  include_jquery="yes"
  ...
}

2) in a case if you would like to use some custom version of jQuery, then switch off these parameters.

{exp:channel:form
  channel="some_channel"
  ...
  include_assets="no"
  include_jquery="no"
  ...
}

However, in the second variant you have to update your layout with:

1) jQuery loading script;

2) all the scripts needed to run Channel Images including jQuery-UI, handlebars etc.;

3) embed the EE {csrf_token} tag to the scripts (see below).

It should look something like that:

  <script src="/bower_components/jquery/jquery.min.js"></script>
  <script src="/bower_components/jquery-ui/jquery-ui.min.js"></script>

  <!-- channel images functions-->
  <script type="text/javascript" charset="utf-8">
    if (typeof EE == "undefined" || ! EE) { 
      var EE = {"publish":{"title_focus":false,"smileys":false,"url_title_prefix":"","default_entry_title":""},"user_id":"7","lang":{"confirm_exit":"When you leave, any data entered will be lost. Are you sure you want to leave?","add_new_html_button":"Add New HTML button"},"XID":"{csrf_token}","CSRF_TOKEN":"{csrf_token}"};
    }
    EE.grid_cache = [];

    window.Grid = {
      bind: function() {
        EE.grid_cache.push(arguments);
      }
    };
    mySettings = {
      "nameSpace":"html","onShiftEnter":{"keepDefault":false,"replaceWith":"<br \/>\n"},"onCtrlEnter":{"keepDefault":false,"openWith":"\n<p>","closeWith":"<\/p>\n"},"markupSet":[{"name":"html_btn_bold","key":"B","openWith":"<strong>","closeWith":"<\/strong>","className":"html-bold"},{"name":"html_btn_italic","key":"I","openWith":"<em>","closeWith":"<\/em>","className":"html-italic"},{"name":"html_btn_blockquote","key":"Q","openWith":"<blockquote>","closeWith":"<\/blockquote>","className":"html-quote"},{"name":"html_btn_anchor","key":"A","openWith":"<a href=\"[![Link:!:http:\/\/]!]\"(!( title=\"[![Title]!]\")!)>","closeWith":"<\/a>","className":"html-link"},{"name":"html_btn_picture","key":"","openWith":"<img src=\"[![Link:!:http:\/\/]!]\" alt=\"[![Alternative text]!]\" \/>","closeWith":"","className":"html-upload"}]
    };
  </script>

  <script type="text/javascript"> var ChannelImages = ChannelImages ? ChannelImages : {};
    ChannelImages.AJAX_URL = '//your_site.com/?ACT=28&site_id=1';
    ChannelImages.THEME_URL = '//your_site.com/themes/user/channel_images/';
    ChannelImages.site_id = '1';
  </script>

  <script src="//your_site.com/themes/user/channel_images/js/handlebars.runtime-v4.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/hbs-templates.js?v=6.0.2" type="text/javascript"></script>

  <script src="//your_site.com/themes/user/channel_images/js/jquery.colorbox.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.editable.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.base64.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.liveurltitle.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/jquery.jcrop.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/swfupload.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/swfupload.queue.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/swfupload.speed.js?v=6.0.2" type="text/javascript"></script>
  <script src="//your_site.com/themes/user/channel_images/js/addon_pbf.js?v=6.0.2" type="text/javascript"></script>

  <script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
    var SafeCracker = {}; SafeCracker.markItUpFields = EE.markItUpFields = {};
  });
  </script>

Best,

Ruslan

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.