beshop Posted Friday at 07:30 PM Share Posted Friday at 07:30 PM (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 7 hours ago by beshop (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted Friday at 09:38 PM Share Posted Friday at 09:38 PM 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 Friday at 09:42 PM Author Share Posted Friday at 09:42 PM (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 Friday at 10:14 PM by beshop (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted Friday at 10:42 PM Share Posted Friday at 10:42 PM 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 Friday at 10:45 PM Author Share Posted Friday at 10:45 PM (edited) I made it. Can you help me? Thanks Edited Friday at 10:50 PM by beshop (see edit history) Link to comment Share on other sites More sharing options...
Nickz Posted Saturday at 12:32 PM Share Posted Saturday at 12:32 PM 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 Saturday at 02:59 PM Author Share Posted Saturday at 02:59 PM 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 Saturday at 03:44 PM Author Share Posted Saturday at 03:44 PM 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 Saturday at 04:09 PM Share Posted Saturday at 04:09 PM (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 Saturday at 04:16 PM 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 Saturday at 04:21 PM Author Share Posted Saturday at 04:21 PM 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 Saturday at 04:47 PM Share Posted Saturday at 04:47 PM 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 Saturday at 07:20 PM Author Share Posted Saturday at 07:20 PM big thanks.. 1 Link to comment Share on other sites More sharing options...
Divine Posted 7 hours ago Share Posted 7 hours ago 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