• Is there any way to exclude some HTML from being minified, like through comments?

    The pagination of the main slider on the site looses it’s spacing, become bunched up, and moves to the top of the midbar.

    I think it is loosing a div or something and the CSS selector no longer applies.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Frederick Townes

    (@fredericktownes)

    if your HTML is valid, minification will not affect layout. Check the W3C validator: https://validator.w3.org/

    You can add define statements listed in the FAQ usage section if you want to add a conditional statement to prevent a page from being minified.

    Thread Starter indole

    (@indole)

    It’s valid under transitional and the errors I get while running strict have nothing to do with that part of code.

    It’s the homepage, so I might as well not turn on minification : )

    I set up a mirror here if you want to take a look. Email me and I can give you an admin login. It is not configured to do inline JS.

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    Email sent.

    Thread Starter indole

    (@indole)

    Any luck? I have had success with other minifiers- maybe you should just include multiple engines on the next release…

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    I’m not able to duplicate the issue. What minify engines would you suggest?

    I had a similar problem and found that it was due to some comment that had not been closed correctly.

    I had a piece of JS which started with the following comment;

    <!– comment

    There was no closed bracket so the HTML minification messed up so it might be worth double checking your code to ensure there are some –> closing all comments.

    sorry I meant use // for comments instead

    strange for some JS its still killing the code. For example

    This code – works

    <a href='//www.voipfone.co.uk/callmeback.php?code=8e52c3e26f38f90a", 350, 400, "", 20, 20)'><img src="https://www.voipfone.co.uk/images/call-me-back.jpg" width="120" height="60" border="0" align="absmiddle"></a>

    Becomes (when HTML minification is active) – and fails

    <a
    href=’JavaScript:openPopWin(“https://www.voipfone.co.uk/callmeback.php?code=8e52c3e26f38f90a&#8221;, 350, 400, “”, 20, 20)’><img
    src=”https://www.voipfone.co.uk/images/call-me-back.jpg&#8221; width=”120″ height=”60″ border=”0″ align=”absmiddle”>

    Looks like the space between the <a and the href= have been removed and seperated onto different lines

    OK, I solved this by avoiding any JS or CSS comment / line removal so when I activated HTML minification (again avoiding comment and line removal) everything worked.

    Excellent!

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    Great.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: W3 Total Cache] Excluding code from minification’ is closed to new replies.