We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44437
    • 74 Posts
    Hey all,

    I am attempting to make a custom TV input Type (range slider) and then use that custom tv within my migx formtabs. The TV works fine outside of MIGX but within the MIGX call I'm getting the following error below:

    Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'element/tv/renders/input/range-slider.tpl'' in 
    /home/myusername/mywebsite.bb/mysubdomain.bb/core/model/smarty/sysplugins/smarty_internal_template.php:162 Stack trace: 
    #0 /home/myusername/mywebsite.bb/mysubdomain.bb/core/model/smarty/sysplugins/smarty_internal_template.php(537): 
    Smarty_Internal_Template->isExisting(true) #1
    /home/myusername/mywebsite.bb/mysubdomain.bb/core/model/smarty/Smarty.class.php(335): Smarty_Internal_Template-
    >getRenderedTemplate() #2
    /home/myusername/mywebsite.bb/mysubdomain.bb/core/model/modx/processors/element/tv/renders/mgr/input/range-slider.php(4):
    Smarty->fetch('element/tv/rend...') #3 
    /home/myusername/mywebsite.bb/mysubdomain.bb/core/model/modx/modtemplatevar.class.php(1281): include('/home/myusern...') #4 
    /home/myusername/mywebsite.bb/mysubdomain.bb/20 in 
    /home/myusername/mywebsite.bb/mysubdomain.bb/core/model/smarty/sysplugins/smarty_internal_template.php on line 
    162
    


    I have created my Custom TV Input Type using this tutorial http://bit.ly/1d9J2dj instead of the latest tutorial http://bit.ly/1yX6lB0 because the latter tutorial doesn't work with Modx 2.3. I could be wrong about the tutorial but I have followed the instructions provided and I'm getting a textbox instead of a selectbox.

    I am using jRange : jQuery Range Selector Plugin to create my range slider. Download via link
    http://www.jqueryrain.com/?LgYVKmg5

    Here are my steps:

    1) Add JQuery, jquery.range.css and jquery.range-min.js to my manager/templates/default/header.tpl

    <!-- range slider -->
    <link href="{$_config.manager_url}templates/{$_config.manager_theme}/css/jquery.range.css" rel="stylesheet">
    <script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
    <script src="{$_config.manager_url}templates/{$_config.manager_theme}/js/jquery.range-min.js"></script>


    2) Create my input controller range-slider.php in core/model/modx/processors/element/tv/renders/mgr/input/range-slider.php

    <?php
    $this->xpdo->lexicon->load('tv_widget');
    
    return $this->xpdo->smarty->fetch('element/tv/renders/input/range-slider.tpl');


    3) Create my input template in manager/templates/default/element/tv/renders/input/range-slider.tpl

    <input id="tv{$tv->id}" name="tv{$tv->id}"
    	type="hidden" class="slider-input"
    	value="{$tv->get('value')|escape}"
    	{$style}
    	tvtype="{$tv->type}"
    />
    
    <script type="text/javascript">
    
    $('.slider-input').jRange({
        from: 0,
        to: 100,
        step: 1,
        scale: [0,25,50,75,100],
        format: '%s',
        width: 300,
        showLabels: true
    });
    
    </script>


    4) Create a TV in manager with an input type as range slider



    Can anyone tell me why I'm getting the error message within MIGX?

    Also, I'm a super noob with xpdo and extjs but how can I set the start range and end range for my custom tv?
      • 4172
      • 5,888 Posts
      first, I think, I would try to use an extjs - slider:
      http://dev.sencha.com/deploy/ext-3.4.0/examples/slider/slider.html

      but I don't think, this is your issue.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!