Mark it up

edited August 2013 in Modules
How do I apply markItUp to a textarea in a module?

I tried jquery..

$('#PackagePricing').markItUp();

Comments

  • edited 9:53AM
    It should be doing it automatically if you are using a MySQL field type of "text". Field types of "varchar" or "char" will get a normal input text field whereas "text" MySQL field types will be given the text field type which will automatically use markItUp!. You can additionally modify your form_fields method on your model like so:
    ... public function form_fields($values = array(), $related = array()){ $fields = parent::form_fields($values, $related); $fields['my_field']['type'] = 'text'; // or "textarea" will work too. return $fields; }
  • edited 9:53AM
    I've created a custom module.. so the text area is not getting markitup applied to it..
  • edited 9:53AM
    When you say a custom module, do you mean you created an advanced module with it's own set of controllers, views, and models, or a simple module that uses just a model? Also, is this with 0.93?
  • edited 9:53AM
    Yes exactly. Sorry I should have been more specific. Advanced module. 0.93..
  • edited 9:53AM
    Is the form coming from a model from within the advanced module... similar to the blog_posts module (which is a simple module using the blog_posts_model.php) under the advanced blog module? Is the field type a "text" field?
  • edited 9:53AM
    textarea.. on the view.. no form helper
  • edited 9:53AM
    Is this a page being rendered outside of the CMS (outside of the "fuel" area). If so, there is a BaseFuelController.js file that is used to initialize the javascript needed to create a markItUp! field while in the CMS and editing a module's data. However, outside of that, it will need to be initiated on it's own. If the page is in the CMS, you can try adding this to your controller's method serving up the page:
    $this->js_controller_params['method'] = 'add_edit';
Sign In or Register to comment.