Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Question How to avoid smarty error when using title="$

    Is possible to avoid an error within Smarty for ScrollTo?

    I have code like:
    <a href="#" title="$(...).scrollTo( 'li:eq(15)', {duration:10000} );" class="mybuttonback">To the Top</a>

    I can not use this as it shows an error inside Smarty templates.

  • #2
    Gütkodierer
    Join Date
    Apr 2009
    Posts
    2,127
    Thanks
    1
    Thanked 426 Times in 424 Posts
    You can't use that anyway — putting code into a title attribute doesn't make any sense. Just keep your code out of your HTML, and you're fine.

    If you do have the need to use the Smarty delimiters (braces) inside your HTML without them being interpreted as Smarty tags, use {ldelim} and {rdelim} instead.
    .My new Javascript tutorial site: http://reallifejs.com/
    .Latest article: Calculators — Tiny jQuery calculator, Full-fledged OOP calculator, Big number calculator
    .Latest quick-bit: Including jQuery — Environment-aware minification and CDNs with local fallback

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,666
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    … or use Smarty’s {literal}

  • #4
    Regular Coder
    Join Date
    May 2006
    Posts
    216
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Thanks for fast reply. It works now.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •