add param for blocks path

edited December 2013 in Feature Requests
I am working with Blocks in Layouts as part of an advanced module and would like the ability to specify block_path as we can with dir_folder. Currently in Fuel_blocks_model, the options_list_with_views method has block_paths as
$blocks_path = APPPATH.'views/_blocks/'.$dir_folder;
Can block_path be added as a param or is there another way I can specify an advanced module folder as the block folder?


  • edited 7:21AM
    In that method, if $dir_folder is an array with the key being the module and the value being the folder, and then the code is changed to something like the following, does it work for you:
    public function options_list_with_views($where = array(), $dir_folder = '', $dir_filter = '^_(.*)|\.html$', $order = TRUE, $recursive = TRUE) { $CI =& get_instance(); $CI->load->helper('directory'); $module_path = APPPATH; if (is_array($dir_folder)) { $module = key($dir_folder); $dir_folder = current($dir_folder); if (is_string($module)) { $module_path = MODULES_PATH.$module; } } $dir_folder = trim($dir_folder, '/'); $blocks_path = $module_path.'views/_blocks/'.$dir_folder; ...
    If so, I can post that change.
  • edited 7:21AM
    Works like a charm! I just had to add a slash before 'views' to make it work.
    $blocks_path = $module_path.'/views/_blocks/'.$dir_folder;
    I keep saying it, but thanks for the responsiveness and great product! The last 6 months of using Fuel (and recently AngularJS - incredibly powerful together) has led to a number of epiphanies about web development. I've been doing this for 15 years and for the first time I feel like as an industry we are finally doing it right.
  • edited 7:21AM
    Great! I've pushed that update. I'm glad you are finding FUEL so helpful. More to come on the FUEL front in the next few weeks so stay tuned!
Sign In or Register to comment.