user6852 Scriptkiddie From France Member since Jul 2019 user6852 Sep 4 2019 01:47 PM Hello everybody, and Tim the boss. Has anyone already faced this question/need ? What's would be the best an complete method to be used and/or implemented to [b]Ajaxly refresh/replace only selected snippets in the templates.[/b] For example in:[i] /includes/templates/*.catalog/layouts/default.inc.php[/i] <div id="main"> { snippet:content } </div> (...)``` How to refresh only the [b][i]snippet:content [/i][/b]to avoid full page reload ? Thanks and have a lovely day.
tim Founder From Sweden Member since May 2013 tim Sep 4 2019 03:07 PM The snippets do not output any placeholders that you can reference. To reference a snippet placeholder you would need to add something like this: { snippet:content } </div> Which would output ... your content output ... </div>``` It could then be replaced with ajax like: ```$('#placeholder-for-content').load('ajax/test.html');```
user6852 Scriptkiddie From France Member since Jul 2019 user6852 Sep 4 2019 03:15 PM Yes, this...for sure I was aware about it. The question was more to know if someone has already found out what is the best way to modify the core files... I think main modifications are somewhere between vqmod.inc.php, lib_document.inc.php, app_headed.inc.php... I'm still investigating how to make it as clean as possible.
tim Founder From Sweden Member since May 2013 tim Sep 4 2019 04:10 PM classes/view.inc.php Or ent_view as it is called in 2.2 has that function that stitches the content. But you cant do it there because it will affect inline snippets as well. You would have to do it in your templates.