Please note that PrestaShop Community sections are largely self-moderated. PrestaShop team members may or may not participate in non-English sections. To improve the chances of receiving feedback to your question or comment, please post it in English to the main sections of our Forum.

Vous parlez français ? par ici !
[Solved] Smarty for code to tpl in modules
#1
Posted 02 October 2008 - 07:58 PM
We are creating a module for skype,
no problems the module works very well if I pass only the account name as smarty.
But if I want to pass all the skype code I have a problem:
<script type="text/javascript"
in tpl file arrive:
<script type="text/javascript"
I tried different encoding (html, utf-8)
I thought I have to use {$foo|noescape} but I can't.
How can I pass an html code from module php to tpl.
I take the code from a form in configure.
Thanks
#2
Posted 02 October 2008 - 10:21 PM
e.g.
function hookLeftColumn($params) {
$output = '
Some html in here to do what you want without smarty getting in the way
return $output;
}
Paul
Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2
Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net
#3
Posted 03 October 2008 - 11:47 AM
I saw different example,
but the friends ho asked us in italian's forum,
want a tpl for following the templates.
Thanks
Christian
#4
Posted 03 October 2008 - 12:10 PM
I'm still unclear as to why a template is required though, you can surely include css classes and styles consistent with the template in the configure box?
Maybe I'm just not getting what you're trying to do, but the existence of a tpl file doesn't influence the application of the current template's "style". Any html placed on the page will be styled using the theme, whether in a tpl file or not.
I guess you may want to add extra "wrapper" code around the value you're passing, but that could surely be included within the module.
Paul
Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2
Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net
#5
Posted 03 October 2008 - 12:24 PM
it's true it is not necessary.
I'll prefer to have,
because we are going to make a module for skype,
but if it's a templates, everyone can use as the want, change the title bar and so on.
I'll use with php-live...other with messenger...
thanks
Christian
#6
Posted 03 October 2008 - 12:41 PM
From Vino al Vino translated:
The Function:
Configuration::updateValue('COD_SKYPE', $gai);static void updateValue( string $key, mixed $values, [boolean $html = false])
Update configuration key and value into database (automatically insert if key does not exist)
Tags:
* access – public
Parameters:
* string $key – Key * mixed $values – $values is an array if the configuration is multilingual, a single string else. * boolean $html – Specify if html is authorized in value
MUST BE:
Configuration::updateValue('COD_SKYPE', $gai, true);
#7
Posted 03 October 2008 - 01:31 PM
Paul
Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2
Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net
#8
Posted 03 October 2008 - 04:17 PM
I create a form
I store the variable in
function getContent()
with:
Configuration::updateValue('COD_SKYPE', $gai, true);the true mean that he can accept html value
then I pass the content with a smarty without any encoding:
Quote
that's all.
You can found the alfa version of the skype module in italian forum:
http://www.prestasho...ltomodulo_skype
#9
Posted 04 October 2008 - 11:44 AM
I think I know why. In the module configuration form I used a textarea to accept multi-line input (the html to add to the page). Unfortunately what happens is that the html tags seem to get stripped by the textarea input control. I use htmlentities when displaying the stored value, and that's fine, but initially there seems to be a problem. I'll need to go and investigate solutions, as this is the final piece in the puzzle I need to fix (a standard, single-line text control doesn't have the same issues).
It seems I was looking for solutions in the wrong place!!!
Paul
Latest Prestashop Developer articles:
* 1.4 Plugins Revisited – Part 1
* 1.4 Plugins Revisited – Part 2
Latest News:
Prestashop Module and Theme Developers can now Advertise on eCartService.net
#10
Posted 04 October 2008 - 04:12 PM
I'll try with single line....
Thanks
http://www.prestasho...viewthread/5992
#11
Posted 04 October 2008 - 04:49 PM
http://www.skype.com/share/buttons/
Just added a 1 line to the end of the SKYPE code.
To make this even easier if thats possible.
I would add an extra field in the admin for username then you don't have to copy & paste the code from skype, just a suggestion.
Probably going to look into this when I get more free time ;)
Available Soon
Filter Search 2.1 Lite Edition
Follow us on twitter
#12
Posted 08 December 2008 - 07:03 AM
From 1222973890:
We are creating a module for skype,
no problems the module works very well if I pass only the account name as smarty.
But if I want to pass all the skype code I have a problem:
<script type="text/javascript"
in tpl file arrive:
<script type="text/javascript"
I tried different encoding (html, utf-8)
I thought I have to use {$foo|noescape} but I can't.
How can I pass an html code from module php to tpl.
I take the code from a form in configure.
Thanks
I have a similar problem too.
I need to insert in product description a module like this:
<head>
[removed]
function check(x)
{
document.getElementById("glow").bgColor=x
}
[removed]
</head>
<body>
What's your favorite browser:
<form>
<input type="radio" name="name">Blue
<input type="radio" name="name">Red
<input type="radio" name="name">Yellow
<input type="radio" name="name">White
<input type="radio" name="name">gray
| slfhsljdf | slfhsljdf |
| ajlsfhjksd | sjdfhsdf |
</form>
</body>Table row "glow" is highlighted whatever color you select.
I need to show my visitors some properties of the products by switching the background color.
I try to paste as HTML in "complete description" field, it appears but it do nothing when radio buttons are clicked.
Ca anyone help me with this problem.
Thanx
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
















