Theo13 Posted July 25, 2014 Share Posted July 25, 2014 Hello, I'm having trouble to display content on an independent page for my module. When I test simple things, like text, there isn't any problem. But I want to create a Fancy Product Designer module, and to integrate it in this page. I thought it was because of this kind of code : <img src="images/basket/left_plain.png" title="1-Base" data-parameters='{"x": 300, "y": 300, "topped": true, "price": 20}' /> And of the custom tags (data-paremeters) but when I test locally by downloading the page and editing it it seems to work, so I don't know if it is a JavaScript problem...? Because I only get a blank page. If someone could help me, it would be very appreciated, I'm struggling with it. I'm attaching a basic version without all the files that are not from the paid module. customproduct.zip Thank you very much ! Link to comment Share on other sites More sharing options...
misthero Posted July 26, 2014 Share Posted July 26, 2014 are you sure the urls are correct? if you have <img src="images/basket/left_plain.png" /> it will look for the images folder starting from the current folder for example if you are on "www.myshop.com/page/mypage" it will look for images in "www.myshop.com/page/images/basket/left_plain.png" the same applies for scripts, css etc.. , in your module all your urls are like that.. you should use {$content_dir} before the url Link to comment Share on other sites More sharing options...
Theo13 Posted July 29, 2014 Author Share Posted July 29, 2014 Oh, thanks. It could have an influence, but I have a blank page: nothing AT ALL is loaded... Link to comment Share on other sites More sharing options...
misthero Posted July 29, 2014 Share Posted July 29, 2014 then there is some error, enable dev mode first, than reload the page Link to comment Share on other sites More sharing options...
Theo13 Posted July 29, 2014 Author Share Posted July 29, 2014 Okay, so the error is Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "/var/www/prestashop/modules/customproduct/views/templates/front/details.tpl" on line 143 "<img src="modules/customproduct/images/basket/left_plain.png" title="1-Base" data-parameters='{"x": 300, "y": 300, "topped": true, "price": 20}' />" - Unexpected ": ", expected one of: "}" , " " , ATTR' in /var/www/prestashop/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php:667 Stack trace: #0 /var/www/prestashop/tools/smarty/sysplugins/smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /var/www/prestashop/tools/smarty/sysplugins/smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(2, ': ') #2 /var/www/prestashop/tools/smarty/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparse in/var/www/prestashop/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 667 So the problem is the data-paremeters on this line. <img src="modules/customproduct/images/basket/left_plain.png" title="1-Base" data-parameters='{"x": 300, "y": 300, "topped": true, "price": 20}' /> But it is essential to make the module work. Do you know if there a way to make this work? Thanks! Link to comment Share on other sites More sharing options...
misthero Posted July 30, 2014 Share Posted July 30, 2014 it's probably the curly brackets confusing smarty, are you storing a json object in the data-parameters? you can try swapping the curly brackets with {rdelim} and {ldelim} {rdelim}"x": 300, "y": 300, "topped": true, "price": 20{ldelim} Link to comment Share on other sites More sharing options...
Theo13 Posted August 11, 2014 Author Share Posted August 11, 2014 It's working, thank you very much. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now