Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Setting <meta> tags in index.html

  1. #1
    Sencha Premium Member AndrewKolas's Avatar
    Join Date
    Feb 2013
    Posts
    2
    Vote Rating
    1
      1  

    Default Setting <meta> tags in index.html

    I've noticed that in IE9 and IE10, my architect app is forced into "Browser Mode: IE(latest) Document Mode: IE8 Standards"
    This causes some formatted dates to be hidden or broken. I know the fix to put the browser into the latest "Document Mode" is to add the following to the page's <head>,
    Code:
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    but I don't see a way to add this in architect so that it won't get overwritten.

    Is there a way or am I going to be stuck reverting this line?

  2. #2
    Sencha Premium User dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,135
    Answers
    25
    Vote Rating
    53
      0  

    Default

    you are correct, there is no way to edit the html file in SA ATM.create a second html file, copy main html file and add your meta tag. (eg meta.html)
    Cloud Application Architect

    Sencha Specialist / Sencha MVP
    ExtJs Developer + Contributor since 0.2.2 - Champion of the per developer license.

  3. #3
    Sencha Premium Member j.vreeken's Avatar
    Join Date
    Apr 2011
    Location
    Netherlands
    Posts
    29
    Vote Rating
    4
      2  

    Default You can however....

    This is what worked for me (SA 3.1, EXT5.x)

    In Architect, create a new JS Resource,
    paste the following js-code:

    Code:
            var meta = document.createElement('meta');
            meta.httpEquiv = "X-UA-Compatible";
            meta.charset = "UTF-8";
            meta.content = "IE=edge";
            console.log('meta', meta);
            document.getElementsByTagName('head')[0].appendChild(meta);
    lock the JS-Resource (it will be saved) and publish your project.
    UI: Sencha Architect 3.1 / ExtJS 5 / Touch 2.4
    Server side:
    PHP
    Databases:
    MySQL, MSSQL, Postgress

  4. #4
    Sencha Premium Member
    Join Date
    Jul 2007
    Location
    Sydney, Australia
    Posts
    261
    Answers
    3
    Vote Rating
    198
      0  

    Default

    Quote Originally Posted by j.vreeken View Post
    This is what worked for me (SA 3.1, EXT5.x)

    In Architect, create a new JS Resource,
    paste the following js-code:

    Code:
            var meta = document.createElement('meta');
            meta.httpEquiv = "X-UA-Compatible";
            meta.charset = "UTF-8";
            meta.content = "IE=edge";
            console.log('meta', meta);
            document.getElementsByTagName('head')[0].appendChild(meta);
    lock the JS-Resource (it will be saved) and publish your project.
    Hi j.vreeken,

    I see what your code is doing, but I am unsure as to how to apply it. Would you mind adding a little more details as to how I can make this work with SA 3.1. It is actually pretty crazy that SA doesn't just do this for us.

    Thanks, Scott

  5. #5
    Sencha Premium Member j.vreeken's Avatar
    Join Date
    Apr 2011
    Location
    Netherlands
    Posts
    29
    Vote Rating
    4
      1  

    Default

    Maybe a picture says more than a thousand words...meta.jpg
    UI: Sencha Architect 3.1 / ExtJS 5 / Touch 2.4
    Server side:
    PHP
    Databases:
    MySQL, MSSQL, Postgress

  6. #6
    Sencha Premium Member
    Join Date
    Jul 2007
    Location
    Sydney, Australia
    Posts
    261
    Answers
    3
    Vote Rating
    198
      0  

    Default

    Quote Originally Posted by j.vreeken View Post
    Maybe a picture says more than a thousand words...
    Thanks for that. You confirmed what I had thought you meant and what I had then tried without success.

    Do I need to build in a particular way in order to get this to load?

  7. #7
    Sencha Premium Member j.vreeken's Avatar
    Join Date
    Apr 2011
    Location
    Netherlands
    Posts
    29
    Vote Rating
    4
      0  

    Default

    Quote Originally Posted by seade View Post
    Do I need to build in a particular way in order to get this to load?
    No you don't.

    You could check if IE is in compatibility mode (seems to default to that on intranet sites). if so, turn it off. I have tested this with IE8 and up, and it does the trick for me.
    UI: Sencha Architect 3.1 / ExtJS 5 / Touch 2.4
    Server side:
    PHP
    Databases:
    MySQL, MSSQL, Postgress

  8. #8
    Sencha Premium Member j.vreeken's Avatar
    Join Date
    Apr 2011
    Location
    Netherlands
    Posts
    29
    Vote Rating
    4
      0  

    Default

    Correction...

    I did not build a web app, i just published the project. That way the meta.js gets executed. When i build a webapp, it just doesn't work. No idea why.
    UI: Sencha Architect 3.1 / ExtJS 5 / Touch 2.4
    Server side:
    PHP
    Databases:
    MySQL, MSSQL, Postgress

  9. #9
    Sencha Premium Member
    Join Date
    Jul 2007
    Location
    Sydney, Australia
    Posts
    261
    Answers
    3
    Vote Rating
    198
      1  

    Default

    Quote Originally Posted by j.vreeken View Post
    Correction...

    I did not build a web app, i just published the project. That way the meta.js gets executed. When i build a webapp, it just doesn't work. No idea why.
    Ahh, that sounds significant.

    For my part, I was under the false impression that the instance of index.html that is preserved by unchecking the "Overwrite index file on save" option needed to be updated when selecting a different build. Upon further investigation it seems this is not the case so this should in fact provide a working solution.

    Sencha Support have also replied that the meta tag is missing from the index.html template used when projects are generated by Sencha Architect and that this will be fixed in the future.

    Thanks for your help, Scott

  10. #10
    Touch Premium Member
    Join Date
    Aug 2009
    Location
    San Diego, CA
    Posts
    35
    Answers
    1
    Vote Rating
    2
      0  

    Default

    Quote Originally Posted by seade View Post
    Ahh, that sounds significant.

    For my part, I was under the false impression that the instance of index.html that is preserved by unchecking the "Overwrite index file on save" option needed to be updated when selecting a different build. Upon further investigation it seems this is not the case so this should in fact provide a working solution.

    Sencha Support have also replied that the meta tag is missing from the index.html template used when projects are generated by Sencha Architect and that this will be fixed in the future.

    Thanks for your help, Scott
    This is 3 years later and there is still no "official" way to add meta info to index.html. Or is there?

Page 1 of 2 12 LastLast

Posting Permissions

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