Knowledgebase

Home » Item #376

I am trying to response.write text in the buildpage.asp file but it appears at the top of the page

Item: #376
Date: 20 Jan 2003
Applies to
v4
v5

Question

I want to write some content in the buildpage.asp file, but when I put a response.write statement in, the text just appears right at the top of the page.

How do I add some text to the page in the buildpage.asp file?

Answer

CactuShop formats pages using a 'skin' template system. The template file is read, and custom tags within the HTML are replaced with strings of text that have been dynamically created in buildpage.asp, such as the category list and mini-basket. Finally, the HTML string is broken into two pieces around the xxxPAGECONTENTxxx tag. These two chunks are then written top and bottom on all front end pages.

The result is that content on each individual page appears within a formatted page with mini-basket, category list, etc. all included. The templating system means that the position of these dynamically generated items can be easily controlled just by editing the skin file.

If you wish to response.write some value, just ensure it is added into the strPageBaseText string in the buildpage.asp file. This string is formatted by concatenating strBasketHTML (the mini-basket), strCategoryListHTML and any other strings you have created within buildpage.asp.

If the item you wanted to response.write has been properly added to the strPageBaseText string, you should see it in the correct position when the HTML chunks created from the template are written to the page.

Can't find the answer you need? Click here to open a support ticket.

« Back