beshop Posted November 29 Share Posted November 29 (edited) Hello, I have a problem, and I can't figure out why it doesn't work. I have a module where I can add a column and display the invoice name (I have custom invoices), but I want to include HTML code in the column. Since HTML is reportedly not supported directly, I created a custom Twig template. However, I keep getting the error: Content template for column type "custom_html" was not found. Modul is in attachmet.. I'm feeling helpless; not even ChatGPT can help me. 😕 BIG thanks fadoorders.zip Edited December 2 by beshop (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted November 29 Share Posted November 29 and how do you expect we could help? Shop version, theme name, 3rd party module or presta? Link to comment Share on other sites More sharing options...
beshop Posted November 29 Author Share Posted November 29 (edited) 35 minutes ago, Nickz said: and how do you expect we could help? Shop version, theme name, 3rd party module or presta? Presstashop 8.1.6. , Theme is default and the module is my example Edited November 29 by beshop (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted November 29 Share Posted November 29 59 minutes ago, beshop said: and the module is my example I know but where did you buy that? Link to comment Share on other sites More sharing options...
beshop Posted November 29 Author Share Posted November 29 (edited) I made it. Can you help me? Thanks Edited November 29 by beshop (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted November 30 Share Posted November 30 I would have to get someone for it and that is not free of cost. There are tutorials for modules: https://devdocs.prestashop-project.org/8/modules/creation/tutorial/ Link to comment Share on other sites More sharing options...
beshop Posted November 30 Author Share Posted November 30 Basically, I don’t actually need a module; I just need information on why PrestaShop 8 doesn’t allow me to insert HTML characters into a column. I included the module here so I wouldn’t have to write long snippets of code in this discussion. What I’m looking for is more about guidance on how to approach this issue, rather than creating a full module for me. Link to comment Share on other sites More sharing options...
beshop Posted November 30 Author Share Posted November 30 When reviewing the debugging logs, it appears that the public function getContentTemplate() method is not being executed. Link to comment Share on other sites More sharing options...
Andrei H Posted November 30 Share Posted November 30 (edited) Hello, I just had a look over the provided module. The problem seems to be the fact that you are not storing the .twig file in the correct location. Moving the .twig file to /modules/fadoorders/views/PrestaShop/Admin/Common/Grid/Columns/Content/custom_html.html.twig should fix your error (I haven't tested but this is most likely case sensitive too), as highlighted in the official documentation I have not tried with your specific .twig file, but creating one with the following code: <div>test</div> outputs the result as in my screenshot. Please let me know if you have any additional queries and I'll try and see if I can help. Edited November 30 by Andrei H Change customhtml to custom_html to match the provided name (see edit history) 1 Link to comment Share on other sites More sharing options...
beshop Posted November 30 Author Share Posted November 30 I tried moving it, but it still doesn't work. I don't understand why. 🤕 Could you please send me the module? Big thanks Link to comment Share on other sites More sharing options...
Andrei H Posted November 30 Share Posted November 30 Hello, Sure thing. I attached it. I actually edited the above message, but the file name must be custom_html.html.twig I also had to comment the line 67 as that was throwing an error. You most likely edited your orders table to have one more column, that's why you do not get that error. fadoorders.zip 1 Link to comment Share on other sites More sharing options...
beshop Posted November 30 Author Share Posted November 30 big thanks.. 1 Link to comment Share on other sites More sharing options...
Divine Posted December 2 Share Posted December 2 Don't forget to edit your first post and to add [Solved] in the title 1 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