Re: founditems / writefile

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 62853
interpreted = N
texte = You're welcome. I should say that I've done this before. There are problems later if you write too much with the writefile. Here's slightly more elegant way to handle this so you don't need to change more than one product page template. The writefile should be: [raw][include file=productlisting.inc&start=[/raw][loopindex][raw]][/raw] This way the URL is static for search engines and the underlying page is easily changed in one template. This way you can put the search in the included file productlisting.inc. An even better way (at least in some situations), is to make the URL convert parameters at the web server level. In Apache, rewriterule and/or rewritemap work well but take some time to understand. For example, in the Apache's httpd.conf file: rewriterule ^/catalog/product([0-9]+).htm$ /catalog/productlist.htm?start=$1 A URL that the world sees like: http://www.domain.com/catalog/product0.htm appears to WebDNA as: http://www.domain.com/catalog/productlist.htm?start=0 If you use this, your links can all look static, but WebDNA still thinks it is receiving parameters in the URL. This avoids any writefiles which make the server messy. Bill -----Original Message----- From: Phil Sent: Fri, 26 Aug 2005 16:51:56 +0200 To: "WebDNA Talk" Subject: Re: founditems / writefile Thanks Bill. Ill try it like that. Have a great weekend! Yours Phil. On 26 Aug 2005, at 16:47, devaulw@onebox.com wrote: > Actually, I'd try loop 0-9. Sorry for the typo. > > Bill > > -----Original Message----- > From: devaulw@onebox.com > Sent: Fri, 26 Aug 2005 10:02:03 -0400 > To: "WebDNA Talk" > Subject: Re: founditems / writefile > > Here's how I'd do it: > > [loop 0-0] > [writefile] > [search SEARCH params&startat=[loopindex]*100&endat=[loopindex]*100 > +99] > [founditems][/founditems] > [/search] > [/writefile] > [/loop] > > Bill > > -----Original Message----- > From: Phil > Sent: Fri, 26 Aug 2005 14:48:39 +0200 > To: "WebDNA Talk" > Subject: founditems / writefile > > Hi Everybody, > > I want to write out my db of 1000 products in static pages, say 100 > per page. > > How do I do it? > > I tried something like > > [search db=products.db&neSKUdatarq=find_all] > > [writefile page1] > > [founditems] > > [product] > > [showif [index]\100] > > [/writefile] > > [writefile page2] > > [/showif] > > [/founditems] > [/search] > > But it didnt work at all... > > Yours > > Philip Edell. > > > > ------------------------------------------------------------- > 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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.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://webdna.smithmicro.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://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: founditems / writefile ( devaulw@onebox.com 2005)
  2. Re: founditems / writefile ( devaulw@onebox.com 2005)
  3. Re: founditems / writefile ( Donovan Brooke 2005)
  4. Re: founditems / writefile ( devaulw@onebox.com 2005)
  5. Re: founditems / writefile ( Donovan Brooke 2005)
  6. Re: founditems / writefile ( devaulw@onebox.com 2005)
  7. Re: founditems / writefile ( Phil 2005)
  8. Re: founditems / writefile ( devaulw@onebox.com 2005)
  9. Re: founditems / writefile ( devaulw@onebox.com 2005)
  10. Re: founditems / writefile ( Gary Krockover 2005)
  11. Re: founditems / writefile ( Gary Krockover 2005)
  12. founditems / writefile ( Phil 2005)
You're welcome. I should say that I've done this before. There are problems later if you write too much with the writefile. Here's slightly more elegant way to handle this so you don't need to change more than one product page template. The writefile should be: [raw][include file=productlisting.inc&start=[/raw][loopindex][raw]][/raw] This way the URL is static for search engines and the underlying page is easily changed in one template. This way you can put the search in the included file productlisting.inc. An even better way (at least in some situations), is to make the URL convert parameters at the web server level. In Apache, rewriterule and/or rewritemap work well but take some time to understand. For example, in the Apache's httpd.conf file: rewriterule ^/catalog/product([0-9]+).htm$ /catalog/productlist.htm?start=$1 A URL that the world sees like: http://www.domain.com/catalog/product0.htm appears to WebDNA as: http://www.domain.com/catalog/productlist.htm?start=0 If you use this, your links can all look static, but WebDNA still thinks it is receiving parameters in the URL. This avoids any writefiles which make the server messy. Bill -----Original Message----- From: Phil Sent: Fri, 26 Aug 2005 16:51:56 +0200 To: "WebDNA Talk" Subject: Re: founditems / writefile Thanks Bill. Ill try it like that. Have a great weekend! Yours Phil. On 26 Aug 2005, at 16:47, devaulw@onebox.com wrote: > Actually, I'd try loop 0-9. Sorry for the typo. > > Bill > > -----Original Message----- > From: devaulw@onebox.com > Sent: Fri, 26 Aug 2005 10:02:03 -0400 > To: "WebDNA Talk" > Subject: Re: founditems / writefile > > Here's how I'd do it: > > [loop 0-0] > [writefile] > [search SEARCH params&startat=[loopindex]*100&endat=[loopindex]*100 > +99] > [founditems][/founditems] > [/search] > [/writefile] > [/loop] > > Bill > > -----Original Message----- > From: Phil > Sent: Fri, 26 Aug 2005 14:48:39 +0200 > To: "WebDNA Talk" > Subject: founditems / writefile > > Hi Everybody, > > I want to write out my db of 1000 products in static pages, say 100 > per page. > > How do I do it? > > I tried something like > > [search db=products.db&neSKUdatarq=find_all] > > [writefile page1] > > [founditems] > > [product] > > [showif [index]\100] > > [/writefile] > > [writefile page2] > > [/showif] > > [/founditems] > [/search] > > But it didnt work at all... > > Yours > > Philip Edell. > > > > ------------------------------------------------------------- > 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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.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 digest@talk.smithmicro.com> > Web Archive of this list is at: http://webdna.smithmicro.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://webdna.smithmicro.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://webdna.smithmicro.com/ devaulw@onebox.com

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:

Re:webten vs. webstar (1998) SiteEdit NewFile.html ? (1997) Database Connectivity (1999) Search/sort in URL Was: GuestBook example (1997) WCf2 and nested tags (1997) Mac v. NT (1998) [protect admin] (1997) Trigger Error (2001) [WebDNA] 2nd pair of eyes on redirect please (2011) hmmm (2006) Another option (2005) removing programming logic white space (2003) Passing values - never mind (1999) Server Freeze (1998) Plugin or CGI or both (1997) read and write you own cookies with webcat (1997) Generating Options for a Form. (1997) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) Silence before the storm? (2004) RE: Missing contexts on NT (1997)