Re: code to phantom spacing

This WebDNA talk-list message is from

2001


It keeps the original formatting.
numero = 36619
interpreted = N
texte = >Even though WebCatalog does not display it's commands when >they have been processed, the linefeeds in the block are not >removed. I have been advocating for a long time that WebCat >strip whitespace except in those contexts that require exact >formatting (only [sendmail] comes to mind). > >You have two options: strip all returns out of your templates >(and stop being able to edit them) or comment out the returns, >via [!][/!] pairs, vis: > > [search db.....][!] > [/!][lineitems] Actually you also have the *third* option, which I consider to be the best one of all. This option has three warnings with it:1- It cannot be used on a page that has a textarea field in it -- unless you don't mind having the 'new line' characters stripped from your textarea field values. Therefore, to avoid this problem, just don't use this technique on those pages.2- If you're using javascript on the page, you'll probably have to reformat it so it works when all the cr's and lf's have been removed. There's a simple tool online at the brainjar.com website that does this for you in a matter of seconds, and you can save the source and use it without even being online because it written in javascript. If you use it on your javascript as I have, it will make my technique work properly on those pages with no problem.3- If you use
 tags on a page, don't use this technique on the same page.By dealing with these three issues properly, my technique will effectively remove all the unnecessary cr and lf characters on the pages you use it on. And if you use tabs in your pages and want to get rid of them too, you can add %09 to the db to get rid of tabs as well.Yes, this even works on pages with [sendmail] contexts in them -- because the sendmail gets processed with the proper formatting intact *before* webcat strips out the unnecessary new line characters from the rest of the page.Here's the technique:1- Create a noReturns.db file for use with the convertchars context as follows, then put it in the globals folder:from to%0A%0D2- Place this tag at the very top of every page (except as noted above). Make sure this tag appears before ANY other text on the page:[convertchars db=^noReturns.db]3- Place this tag at the very bottom of the same pages. Make sure this tag appears after ALL the other text on the page:[/convertchars]That's all there is to it!  To see the results, simply view the source of any page you use it on after requesting that page via your web browser ...  :)=================================================Kenneth Grome                   WebDNA Consultanttelephone number:              011 63 32 486-9077telephone number:             011 63 919 749-0060business web site:              http://webdna.netpersonal web site:            http://kengrome.com=================================================-------------------------------------------------------------This message is sent to you because you are subscribed to  the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/





Associated Messages, from the most recent to the oldest:

    
  1. Re: code to phantom spacing (Glenn Busbin 2001)
  2. Re: code to phantom spacing (Jon Robinson 2001)
  3. Re: code to phantom spacing (Jon Robinson 2001)
  4. Re: code to phantom spacing (Kenneth Grome 2001)
  5. Re: code to phantom spacing (Kenneth Grome 2001)
  6. Re: code to phantom spacing (Jon Robinson 2001)
  7. Re: code to phantom spacing (Brian Fries 2001)
  8. Re: code to phantom spacing (John Peacock 2001)
  9. Re: code to phantom spacing (Jon Robinson 2001)
  10. Re: code to phantom spacing (Jon Robinson 2001)
  11. Re: Was Re: code to phantom spacing -- now BBEdit [!][/!] (Paolo Coppo 2001)
  12. Re: Was Re: code to phantom spacing -- now BBEdit [!][/!] (John Peacock 2001)
  13. Re: Was Re: code to phantom spacing -- now BBEdit [!][/!] (dale 2001)
  14. Was Re: code to phantom spacing -- now BBEdit [!][/!] (Christopher Mackay 2001)
  15. Re: code to phantom spacing (John Peacock 2001)
  16. Re: code to phantom spacing (Samuel Renkert 2001)
  17. Re: code to phantom spacing (Kenneth Grome 2001)
  18. Re: code to phantom spacing (Jon Robinson 2001)
  19. Re: code to phantom spacing (Kenneth Grome 2001)
  20. Re: code to phantom spacing (Jon Robinson 2001)
  21. Re: code to phantom spacing (Jon Robinson 2001)
  22. Re: code to phantom spacing (Jon Robinson 2001)
  23. Re: code to phantom spacing (Kenneth Grome 2001)
  24. Re: code to phantom spacing (Glenn Busbin 2001)
  25. Re: code to phantom spacing (Jon Robinson 2001)
  26. Re: code to phantom spacing (Kenneth Grome 2001)
  27. Re: code to phantom spacing (John Peacock 2001)
  28. Re: code to phantom spacing (Kenneth Grome 2001)
  29. code to phantom spacing (Jon Robinson 2001)
>Even though WebCatalog does not display it's commands when >they have been processed, the linefeeds in the block are not >removed. I have been advocating for a long time that WebCat >strip whitespace except in those contexts that require exact >formatting (only [sendmail] comes to mind). > >You have two options: strip all returns out of your templates >(and stop being able to edit them) or comment out the returns, >via [!][/!] pairs, vis: > > [search db.....][!] > [/!][lineitems] Actually you also have the *third* option, which I consider to be the best one of all. This option has three warnings with it:1- It cannot be used on a page that has a textarea field in it -- unless you don't mind having the 'new line' characters stripped from your textarea field values. Therefore, to avoid this problem, just don't use this technique on those pages.2- If you're using javascript on the page, you'll probably have to reformat it so it works when all the cr's and lf's have been removed. There's a simple tool online at the brainjar.com website that does this for you in a matter of seconds, and you can save the source and use it without even being online because it written in javascript. If you use it on your javascript as I have, it will make my technique work properly on those pages with no problem.3- If you use
 tags on a page, don't use this technique on the same page.By dealing with these three issues properly, my technique will effectively remove all the unnecessary cr and lf characters on the pages you use it on. And if you use tabs in your pages and want to get rid of them too, you can add %09 to the db to get rid of tabs as well.Yes, this even works on pages with [sendmail] contexts in them -- because the sendmail gets processed with the proper formatting intact *before* webcat strips out the unnecessary new line characters from the rest of the page.Here's the technique:1- Create a noReturns.db file for use with the convertchars context as follows, then put it in the globals folder:from to%0A%0D2- Place this tag at the very top of every page (except as noted above). Make sure this tag appears before ANY other text on the page:[convertchars db=^noReturns.db]3- Place this tag at the very bottom of the same pages. Make sure this tag appears after ALL the other text on the page:[/convertchars]That's all there is to it!  To see the results, simply view the source of any page you use it on after requesting that page via your web browser ...  :)=================================================Kenneth Grome                   WebDNA Consultanttelephone number:              011 63 32 486-9077telephone number:             011 63 919 749-0060business web site:              http://webdna.netpersonal web site:            http://kengrome.com=================================================-------------------------------------------------------------This message is sent to you because you are subscribed to  the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/



Kenneth Grome 

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

SMSI: Forged email addresses on the talk list ... (2002) PCS Frames (1997) [WebDNA] WebDNA and Coda 2 - Get it up and running... (macOS) (2018) WebCatalog Hosting (1996) showcart is slow (1998) Almost a there but..bye bye NetCloak (1997) emailer w/F2 (1997) WebCommerce: Folder organization ? (1997) WC Bulletin Board Issue (2003) Dates - Search and Sorting (1999) [WebDNA] sem_open bugfix for os x version 6.2 (2012) Looping control (1997) No answers by SM? (2000) Laying an egg. (1998) Changes to the List (1997) Can this be done? (2003) SMSI: databases corrupted on crash and permission issueson OSX (2002) Tracking inbound links for discounts (1997) if else problem (2003) problems with 2 tags (1997)