Using different editors for blocks and pages

edited February 2014 in Modules
I am using blocks to define various sections so that only requires text-box (markitup)
but pages need wysiwyg (ckeditor)

I know that fuel/application/config/MY_fuel.php defines the global config for this.

Can I have my own control over which module displays which type of editor? how?

Comments

  • edited February 2014
    didnt want to start another discussion on this:

    I am using CMS database to store blocks and pages. When saving references to images, javascripts etc
    /assets/js/script.js //or /assets/assets/logo.png //the editor converts it to {js_path('scripts.js')} //or {image_path('/assets/logo.png')} // why would this not show the image?
    but i think this is breaking the views when logo.png is not found in path. What are best practices when saving image/scripts references within the editors? I am using fuel v1.0.4
  • edited February 2014
    btw i have my own assets folder in /assets
    and there is a typo in http://docs.getfuelcms.com/general/template-parsing
    the heading says "Temlate Parsing"
  • edited February 2014
    Is there a way to include defined blocks from within the html saved by the editor?

    for example something like:
    <p> {include_widget('calendar')} </p>
  • edited 9:35AM
    Yes.
    {fuel_block('calendar')} {fuel_block('calendar', array(key="val",...))}
  • edited 9:35AM
    can you elaborate on the part above related to referencing the images and scripts? my image links dont work when i save them in the editor. Maybe its a bug.
  • edited 9:35AM
    With regards to using a different editor on a per field basis, there is an "editor" parameter you can pass to your form field in which you can specify "markitup" or "wysiwyg":
    http://docs.getfuelcms.com/general/forms#wysiwyg

    Regarding the image_path function, it's actually, img_path():
    <img src="{img_path('/assets/logo.png')}" alt="">

    Thanks for the heads up on the typo. That should be fixed now.
  • edited February 2014
    NOTED img_path not image_path.
    But the img_path function once saved in database, is being published as is without plugging in the image path.

    //getting this error <h1>An Error Was Encountered</h1> <p>Compilation error at line 13 in "string:" : Parse error in "logo.png)}" /> //AND as you can see here the path was not translated <img alt="Image" src="{img_path(/assets/slide-3.png)}" />
  • edited 9:35AM
    Is this in your own module? If so, in your model, specify the fields you want template parsing performed using the parsed_fields model property:
    public $parsed_fields = array('content', 'content_formatted');
    In the example, this says to parse the record property of "content" and the magic property "content_formatted"

    If you are talking about strictly parsing a block, you can pass the "parse" parameter like so:
    {fuel_block(array(view = "calendar", parse = true))}
    Note that the above syntax is using an array to pass parameters which is necessary since you are passing more then just the view to load for the block.
  • edited 9:35AM
    I must say that $parsed_fields option is beautiful. hehe

    but I am saving the body content in fuel's pages module. In ckeditor when referencing FQPN /assets/assets/logo.png or /assets/images/image.png or /assets/js/script.js and when saved it replaces it to {img_path('/assets/logo.png')} OR {img_path('/logo.png')} OR {js_path('/js/scripts.js')}
    then it shows up the same way on front-end with img_path parts intact...
  • edited February 2014
    Are you saying that you are actually seeing the untranslated {img_path(... function in the HTML output? Like the parser isn't parsing that function? Are you still seeing that compilation error?

    BTW... img_path starts at the assets/images folder so you'll want something like {img_path('logo.png')}. Similarly, javascript starts at the assets/js folder {js_path('scripts.js')}
  • edited February 2014
    Yes thats what I am saying.. this is from html src in web browser it is not parsing.

    // actual excerpt of content html saved in database by ckeditor for path i gave was /assets/images/logo.png <img alt="" height="34" src="{img_path(/logo.png)}" /> // actual output view source <div id="error_general"> <h1>An Error Was Encountered</h1> <p>Compilation error at line 13 in "string:" : Parse error in "logo.png)}" /> </a></h1>

    btw if i remove the slash and save {img_path(logo.png)} the error goes away.
  • edited 9:35AM
    OK I figured it out. Here is whats going on and its sort of a bug.
    When and If i give the FQPN /assets/images/logo.png
    The ckeditor parses it and plugs in img_path but the slash remains (i.e. {img_path(/logo.png)} ) that breaks the front end parser.
  • edited 9:35AM
    OK. Thanks for the report.
Sign In or Register to comment.