$Resource validation/pasting issue in Visualforce page with style tag

The Welkin Suite Forum

$Resource validation/pasting issue in Visualforce page with style tag



$Resource validation/pasting issue in Visualforce page with style tag

  • Please log in to reply

#1

jkeener1

    Posted 28 Aug 2015

    An issue I noticed recently is with using a style tag in a visualforce page.  The issue occurs when a $Resource is referenced.


    An example would be the following in a page:

    <style>
        .testMinusStyle {
            color: #FFF;
            background: #1797C0 url({!URLFOR($Resource.jQuery1x,'jQueryPlugins/jqEasySlidePanel/images/minus.png')}) 6% 55% no-repeat;
        }
    </style>
    

    First, if you just copy and paste the above into an existing visualforce page in Welkin Suite, some sort of auto-formatting is occuring so what you actually get in the editor after pasting is:

    <style>
        .testMinusStyle {
            color: #FFF;
            background: #1797C0 url({!URLFOR($Resource.jQuery1x,'jQueryPlugins/jqEasySlidePanel/images/minus.png');
        }
    
         ) 6% 55% no-repeat;
        }
    </style>
    

    The autoformatting is adding a semi-colon and splitting it into two items.


    I ran into this when I was copying an existing page into a new page and the new page would save because of the formatting adjusted to css like this.


    If you manually type/fix it, the page will save, although the editior does underline it in green with a validation error.




    0 replies to this topic



    Boost Your Productivity. Get Started Today

    Try Free Trial