Re: Problems passing [SKU] with $Replace in 2.0

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 10941
interpreted = N
texte = Grant Hulbert wrote: > > Trevor, I'm trying to get a feel for what you're trying to do here so I can suggest alternatives that may work better. I can't quite tell yet, but I think maybe you're using $Replace in a way that it's not designed to work. Sorry, but I don't think I was clear enough with what I am trying to do with this. This is part of the Jackson Hole site we are working on right now. We are setting it up so that the entire site is generated by WebCatalog and all pages have a corresponding record in the database. We are doing this so that we can then allow our clients the ability to go in and change the text and layout of each page. So, first they go to a page that lets them search for which record they want to edit. That page is a form based page with a $Search command. The template it returns has the following code (from my first email) and the [SKU] does get replaced here> >----------------------- > >The replace code--> > >----------------------- > > > >
> > > >I did not include the entire code, but in this section of the page are several fields so the user can edit the record. So, the SKU has been determined, the user alters their data, hits submit-->> > > >
And the data is replaced in the database. Now is where things get tricky. We are trying to set this up, so a variety of things occur.1. The entire site can be generated on the fly so we can pass a cart through the whole thing. 2. The entire site gets rendered, using the [WriteFile] context, so that every page on the site is accessible to spiders.So at this point, the record has been altered in the database, but we need the page to be rendered. So, we want to give the user a preview of their page before they render it. So what I want to have happen is for the template generated by the $Replace command to pass the SKU to the next page to be specified in a [Search] context, which will then generate a preview of the page they have just created. > >----------------------- > >The corresponding code in guidemodified.tmpl--> > >----------------------- > > > >[Search db=/WebCatalog/jackson.db&eqSKUdata=[SKU]] > >[FoundItems] > >
> > >VALUE=/templates/[TemplateName]preview.tmpl> > > > > > > > As I stated in my first email, this works just fine if, instead of the SKU field, I use another unique field from the record. In this case - BusinessName. I could just use that field instead of SKU, but that could present a problem as the database becomes larger, and there is a possibilty of duplications in the BusinessName field. [Search db=/WebCatalog/jackson.db&eqBusinessNamedata=[URL][BusinessName][/URL]] [FoundItems] [/FoundItems] [/Search]Hope that helps in clarifying my problem.Trevor Crist Digital Frontier http://www.digitalfrontier.com Associated Messages, from the most recent to the oldest:

    
  1. Re: Problems passing [SKU] with $Replace in 2.0 (Trevor Crist 1997)
  2. Re: Problems passing [SKU] with $Replace in 2.0 (Grant Hulbert 1997)
  3. Re: Problems passing [SKU] with $Replace in 2.0 (Kenneth Grome 1997)
  4. Problems passing [SKU] with $Replace in 2.0 (Trevor Crist 1997)
Grant Hulbert wrote: > > Trevor, I'm trying to get a feel for what you're trying to do here so I can suggest alternatives that may work better. I can't quite tell yet, but I think maybe you're using $Replace in a way that it's not designed to work. Sorry, but I don't think I was clear enough with what I am trying to do with this. This is part of the Jackson Hole site we are working on right now. We are setting it up so that the entire site is generated by WebCatalog and all pages have a corresponding record in the database. We are doing this so that we can then allow our clients the ability to go in and change the text and layout of each page. So, first they go to a page that lets them search for which record they want to edit. That page is a form based page with a $Search command. The template it returns has the following code (from my first email) and the [SKU] does get replaced here> >----------------------- > >The replace code--> > >----------------------- > > > > > > > >I did not include the entire code, but in this section of the page are several fields so the user can edit the record. So, the SKU has been determined, the user alters their data, hits submit-->> > > >
And the data is replaced in the database. Now is where things get tricky. We are trying to set this up, so a variety of things occur.1. The entire site can be generated on the fly so we can pass a cart through the whole thing. 2. The entire site gets rendered, using the [writefile] context, so that every page on the site is accessible to spiders.So at this point, the record has been altered in the database, but we need the page to be rendered. So, we want to give the user a preview of their page before they render it. So what I want to have happen is for the template generated by the $Replace command to pass the SKU to the next page to be specified in a [search] context, which will then generate a preview of the page they have just created. > >----------------------- > >The corresponding code in guidemodified.tmpl--> > >----------------------- > > > >[Search db=/WebCatalog/jackson.db&eqSKUdata=[SKU]] > >[founditems] > >
> > >VALUE=/templates/[TemplateName]preview.tmpl> > > > > > > > As I stated in my first email, this works just fine if, instead of the SKU field, I use another unique field from the record. In this case - BusinessName. I could just use that field instead of SKU, but that could present a problem as the database becomes larger, and there is a possibilty of duplications in the BusinessName field. [Search db=/WebCatalog/jackson.db&eqBusinessNamedata=[url][BusinessName][/URL]] [founditems] [/FoundItems] [/Search]Hope that helps in clarifying my problem.Trevor Crist Digital Frontier http://www.digitalfrontier.com Trevor Crist

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:

Emailer tracking (1997) RequiredFields template (1997) WebCat Emailer & Liststar (1997) Cookies and webcat (1997) problems with 2 tags shakur (1997) day of year (2001) Questions To Answer (1997) Can this be done? (1997) Add to a field (1998) HTML Editors (1997) Shopping carts and reloading pages (1997) Cart questions (1997) NT BETA BUG???? (1997) Stopping bad HTML propagation ? (1997) WebMerchant 1.6 and SHTML (1997) loops (2000) Server problem? (1998) ShipTotal Again (1998) [BULK] [WebDNA] Candidate versions release (2010) Advanced WebCat Guidelines - do they exist beyond docs (1999)