Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Comment inside literal

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Jamarchi
Smarty Rookie


Joined: 06 Sep 2018
Posts: 11

PostPosted: Mon Oct 15, 2018 3:17 pm    Post subject: Comment inside literal Reply with quote

Hi to all

I have a question, I have the follow code, my boss told me that its necessary to hide the comments but I have problem with that....

Code:
{literal}

<!--<script async type="text/javascript" src="/assets/plugins/bootstrap/js/bootstrap.min.js"></script>-->
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<script type="text/javascript" src="/assets/plugins/sidr/jquery.sidr.min.js"></script>
<script src="/assets/js/scripts-footer-min.js"></script>
<!--<script type="text/javascript" src="/assets/plugins/hover-dropdown.min.js"></script>
<script type="text/javascript" src="/assets/plugins/fancybox/source/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="/assets/plugins/psScrollbar/psScrollw_mw.min.js"></script>
<script type="text/javascript" src="/assets/plugins/sidr/jquery.sidr.min.js"></script>
<script type="text/javascript" src="/assets/js/app.js"></script>
<script type="text/javascript" src="/assets/js/isIndexImported.js"></script>
 -->
<!-- Google Analytics -->
<!--<script type="text/javascript" src="/assets/js/google-analytics.js"></script> -->
<script async src='//www.google-analytics.com/analytics.js'></script>
<!-- End Google Analytics -->

<!--<script type="text/javascript" src="/assets/js/facebook-pixel-code.js"></script> -->
<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=1710529292584739&ev=PageView&noscript=1"/></noscript>
<!-- DO NOT MODIFY -->
<!-- End Facebook Pixel Code -->
{/literal}


But when I saw the source code of the page I saw the comments <!-- -->, I have tried to use {* *} but don[t work

Is there a way to hide the comments in literal for source code ?

Thank you for your help
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Oct 15, 2018 7:42 pm    Post subject: Reply with quote

{literal} prevents any smarty parsing. So, "{* *}" won't work.
The HTML comments, however… why not just remove them?
And move googlecrap to a separate include. (That's a strong suggestion.)
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Tue Oct 16, 2018 1:22 am    Post subject: Reply with quote

Unless there is more than what you posted, I do not see any actual javascript or actual CSS. Actual javascript and CSS could have tight braces which is the cause for the use of {literal} is necessary.

You could experiment by removing {literal}, then wrapping the to be hidden <script src> tags in Smarty comment tags.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP