AnsweredAssumed Answered

CE 6.5.14 Invoke smarty template from ediitviewdefs.php

Question asked by community-support on Jan 13, 2014
Latest reply on Jan 13, 2014 by community-support

   I want to replace a text field with a smarty tpl.  I imagine I should do this from editviewdef.php.  What I want to feed into the tpl is an array from a sql query that I will use to display a custom table.

   For instance:

   'customCode' => '{include file='custom/modules//tpls/template.tpl'}',

   For an example for the template:

{if $view == 'EditView' || $view == 'QuickCreate' || $view == 'QuickEdit'}

{foreach $NAMES as $name}




   So my question is where do I do the db query?, and how do I assign the values to the template?

   I thought at first I should do it in the module script in custom directory, but then I thought I would have to use

   new Sugar_Smarty(),

   and if I did that then still how does it know which template.....

   so I am a little confused about where do the dq query and tpl->assign...

   I hope someone can help me get back on the right track with this.

   Thank you


(from ewpeanutty)