Data at Your Fingertips: Explore Our New Reporting and Statistical Capabilities By Ryan Ashbrook 23 hours ago
NiallC Posted April 4, 2019 Share Posted April 4, 2019 Was tracking down an error caused by upgrading to 4.4.2 and it would have been useful to comment out some template code, but I don't know how. https://invisioncommunity.com/4guides/themes-and-customizations/template-syntax/ doesn't mention comments Would anyone like to clue me in? Niallc Link to comment Share on other sites More sharing options...
Lucas James Posted April 5, 2019 Share Posted April 5, 2019 (edited) for HTML: <!-- Your code goes here --> for CSS: /* Your code goes here */ Edited April 5, 2019 by Lucas James NiallC 1 Link to comment Share on other sites More sharing options...
NiallC Posted April 5, 2019 Author Share Posted April 5, 2019 Gotcha. That makes sense. Thanks. Link to comment Share on other sites More sharing options...
mcsg Posted December 12, 2020 Share Posted December 12, 2020 (edited) From my experience, the template excutable code surrounded by {{ execute this; }} like the following still gets executed, even while in <!-- --> Following should be blank, but the template code still execute and will throw an error <!-- This gets executed This gets executed {{$var 20;}} and throws the error Does this print? {$var} --> The following will NOT throw an error: Following should be blank, and is commented out correctly <!-- This gets executed This gets executed {{ // $var 20;}} but does NOT throw the error Does this print? {$var} --> Since executable template codes needs to be on one line for each command, is there a fast way to comment out each of these execution lines? Edited December 12, 2020 by mcsg spelling Link to comment Share on other sites More sharing options...
bfarber Posted December 14, 2020 Share Posted December 14, 2020 You are adding an HTML comment around PHP code. The PHP code will still execute in that context, but the result will be inside an HTML comment that the browser will hide. You would need to comment out the PHP code using PHP commenting functionality like {{ /* Don't execute this}} {{ $var = 'x';}} {{ */}} Meddysong and IPCommerceFan 2 Link to comment Share on other sites More sharing options...
mcsg Posted December 14, 2020 Share Posted December 14, 2020 Ah that's better than commenting out every line. Now, if only the ACP editor had a command for that like: ctrl|cmd-/ Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts