Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tim 66 posts 89 karma points
    Dec 21, 2011 @ 02:08
    Tim
    0

    Javascript tags stopping Template from saving

    I have a very very strange problem.

    Stats:

    Windows 2008 R2

    Umbraco 4.7.1

    I've moved my site from my local machine (which works fine) to my clients web server . I've set all the file permissions correctly and the website works fine UNTIL I want to make a change to a template in umbraco. When I try to save my top template it says

    "please make sure that you do not have 2 templates with the same alias"

    Before jumping to conclusions. If i remove the following lines:

    <script type="text/javascript">

           Cufon.replace('#townLetter'); 

          Cufon.replace('h1'); 

          Cufon.replace('h2'); 

          Cufon.replace('h3');

          Cufon.replace('h4');

        </script>    

    The template saves, if I try to reinsert the script it fails. So I know my permissions are set correctly as I can save templates and I can create new ones, but anything within Script tags causes errors. I'm also positive that I dont have two templates with the same alias as I've read this can be misleading.

    I also have the same problem with child template which has: 

     

        <script type="text/javascript">
        $(window).load(function({
          $('#slider').nivoSlider({
           effect'fade',
            animSpeed500// Slide transition speed
            pauseTime4000// How long each slide will show
            startSlide0// Set starting Slide (0 index)
            directionNavtrue
            
            
          });
        });
        </script

    I've never had this probem before with my own servers. 

    I would be immensley grateful if someone can help me

    Thanks

    Tim

  • Nigel Wilson 944 posts 2076 karma points
    Dec 21, 2011 @ 03:24
    Nigel Wilson
    0

    Hey

    Just wondering...

    Can you ftp the changes to the server, and if so, do they work OK ?

    I appreciate this may not solve your problem but may provide clues as to where the issue lies.

    Nigel

  • Tim 66 posts 89 karma points
    Dec 21, 2011 @ 03:29
    Tim
    0

    Hi Nigel,

    Yes I can upload changes and they work, the problem is that my client restricts access via pre-agreed IP addresses, which is not good for me as I travel around a lot, so if i need to make any emergency changes I need to head back to the office to make them.

    Tim

  • Davide Oliva 35 posts 199 karma points
    Mar 28, 2012 @ 15:03
    Davide Oliva
    0

    Hi all!

    I have the same problem as Tim has.

    Putting files via FTP works fine, but editing a template with more than one <script> tag cause an error like "please make sure that you do not have 2 templates with the same alias".

    Like Tim I have queried the db, but seems there are no duplicate templates.

    Someone have an idea?

  • Tim 66 posts 89 karma points
    Mar 28, 2012 @ 15:16
    Tim
    0

    Hi Davide,

    From recollection (quite hazy now) the issue arose with having two script tags in the template, to fix it I put the other javascript into xslt macros (using lots of escape characters) and then inserting the macro into the template.

    Not the ideal way of doing things but the only way I could get around the issue.

    Thanks

    Tim

  • Davide Oliva 35 posts 199 karma points
    Mar 28, 2012 @ 16:32
    Davide Oliva
    0

    Thank you Tim. I think that I have to follow your example.

    Do you use Umbraco version 4.7.1.1 (Assembly 1.0.4393.24044) ?

    Furthermore, I've noticed that self-closing tags like <script type="text/javascript" src="/scripts/functions.js" />, while not render correctly due to xhtml DTD, doesn't cause any error in saving the template.

  • Davide Oliva 35 posts 199 karma points
    Mar 28, 2012 @ 17:19
    Davide Oliva
    0

    I think that is useful open an issue on codeplex about this problem.

    http://umbraco.codeplex.com/workitem/30767

Please Sign in or register to post replies

Write your reply to:

Draft