Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## dotCMS - Strip whitespace out of current page with only velocity
- #if($request.getParameter("withwhitespace")!="true")
- ## Load the alternate version of this page into memory
- #set($pageurl = "http://${SERVER_NAME}${VTLSERVLET_URI}?withwhitespace=true&${request.getQueryString()}")
- #set($pagesource = $import.read("${pageurl}"))
- ## Strip out all special characters and change to one-space
- #set($pagesource = $pagesource.replaceAll("[\s]"," "))
- #set($pagesource = $pagesource.replaceAll("[ ]{1,999}"," "))
- ## Put source back into the page
- $pagesource
- #else
- YOUR REGULAR PAGE
- CODE
- <p><strong>Lots of white space here</strong></p>
- <p>This page is kind of a mess</p>
- $request.getParameter("dolphin")
- <ul>
- #foreach($blogEntry in $dotcontent.pull("+structureName:Blogentry ",10,"modDate desc"))
- <li>$blogEntry.title</li>
- #end
- </ul>
- #end
Advertisement
Add Comment
Please, Sign In to add comment