VP-ASP :: Shopping Cart Software

Shopping Cart Software Solutions for anywhere in the World

US/Canada(Toll Free): +1 888 587 2278
Europe/UK: +44 (020) 7193 9408
Australia/New Zealand: +61 3 9016 4497

VP-ASP Shopping Cart Customer Forum

Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VPCart Forum
 Suggestions for future release
 Asp script with HTML templates
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

midobu
Starting Member

USA
42 Posts

Posted - March 25 2003 :  14:12:00  Show Profile  Reply with Quote
I really wish I can directly work at HTML templates (no mailing templates) with ASP scripts. Can you make ASP templates, instead of HTML templates? Why are HTML templates so better than regular ASP pages?



Edited by - midobu on March 25 2003 16:37:22

Superal
VP-ASP Expert

Canada
542 Posts

Posted - March 26 2003 :  01:03:28  Show Profile  Reply with Quote
HTML templates are so easy to work with. Easy in FrontPage or DreamWeaver. With these you get the WYSIWYG right before your eyes. Much better and easier to maintain changes with templates.

ASP on the other hand should be worked with a plain text editor. No WYSIWYG. You can only see the end result once it is on the server. Hard to lay out tables , row/column spans. You have to imagine it with ASP but with HTML viola, right before your eyes!

Go to Top of Page

midobu
Starting Member

USA
42 Posts

Posted - March 26 2003 :  13:42:50  Show Profile  Reply with Quote
I think ASP scriptable template is more flexible to modify when it comes to do scripting. Just adding one line of "IF ... THEN" statement can be so much easier than to dig in and change scripts in shopproductformat_template.asp and shopfileio.asp files. I wish there will be an option to select ASP scriptable template or HTML template in the future.

Edited by - midobu on March 26 2003 13:52:17
Go to Top of Page

Superal
VP-ASP Expert

Canada
542 Posts

Posted - March 26 2003 :  15:24:20  Show Profile  Reply with Quote
ASP is just dynamic html. By editing the html template it is easy to put if... then statements or java in them. You do not edit shopproductformat_template.asp or shopfileio.asp files. In an html file, just put the asp delimiters <%...%> and the code where you need the dynamic part. You can include asp, txt or html in an asp or html file. Really simple. Just look at how VPASP has created some of their pages as to clues how this is done.

Go to Top of Page

nick180
Starting Member

3 Posts

Posted - December 26 2003 :  22:08:25  Show Profile  Reply with Quote
are you sure I can use <% %> within my html templates? Maybe my brain isn't functioning correctly right now, but I have not been able to get any asp to work. It completley ignores anything I place within the <% %> tags.

Go to Top of Page

patrickong
VP-ASP New User

Singapore
58 Posts

Posted - January 24 2004 :  11:08:19  Show Profile  Visit patrickong's Homepage  Reply with Quote
Hi, you need to read up more books starting from the basics of VBScript or ASP to know how to work with <% %> within your html files and/or templates.

You can find all these basic lessons by searching in Google which will save you lots of money and time from going to the library or bookstore.

I'm still learning and got lots more to learn.. :-)

Go to Top of Page

jonmadrid
VP-ASP New User

USA
192 Posts

Posted - January 24 2004 :  16:48:26  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
This is mostly in response to nick180's post but relates to the general topic here.

Within the VP-ASP cart framework you can include ASP in HTML pages because they are called by an ASP page. In essence that HTML page becomes ASP when that happens. At that point anything within <% %> tags is obviously recognized as ASP and will be rendered as such.

I have noticed some limitations as to what you can and can't put directly in your HTML pages with VP-ASP. A few things here and there have caused some errors for me. However, since all the pages of the cart have shop$db.asp included in them, you can write any ASP stuff you want in there, wrap it in a sub and call it from anywhere in the cart. Its actually very handy for things you need to use multiple times in disparate locations. For example you might have some code in the shop$db.asp file that generates a menu of some sort.

Sub GenerateSomeMenu
'ASP code here.
End Sub

Then on your HTML pages, you can call that sub as simply as this

<% GenerateSomeMenu %>

That will then call that ASP code you wrote (as a sub routine) in the shop$db.asp file and execute it inline in the HTML code.

Hope that sheds some light on the topic.

All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page

devshb
Senior Member

United Kingdom
1898 Posts

Posted - January 30 2004 :  09:10:59  Show Profile  Visit devshb's Homepage  Reply with Quote
I think I can see what both sides of the argument are getting at here.

Someone can correct me if I'm wrong, but I think the problem is NOT that people can't get ASP to work within HTMLs, but that some people DON'T WANT asp code inside their HTML-generated files; they want only raw html code in final html files that the HTML-generator creates.

In that instance (where someone only wants raw html in the generated files), the question is, does the html-generator process ASP that's embedded into the template at the time that the html-files get created or does it just get pasted into the generated html files as part of the rest of the template ?

I'd like to know the answer to that question, too!

What I'm trying to say (and it's difficult to explain!) is -

When using html templates to generate html-files through the html-generator, does the asp code inside the template just get physically copied/pasted into the generated html files, or is that asp code processed by the html-generator as if it's part of the generation-function itself (ie with all relevant functions/variables available to it).

I'm trying to do exactly the same thing as the original posting-user; I want to use asp code inside the html-template, but I want that code to be run when the files are generated and not when the html is loaded into a browser. This is for things like creating category lists in the header driven by the category table, where you don't want the generated html-files to have any asp code inside them, so that, say, every week you can regenerate your html files and it'll put the latest categories in them without having any asp code in those htmls.

Edited by - devshb on January 30 2004 09:14:58

Edited by - devshb on January 30 2004 09:19:18

Edited by - devshb on January 30 2004 09:24:02
Go to Top of Page

jonmadrid
VP-ASP New User

USA
192 Posts

Posted - January 30 2004 :  09:30:43  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
Devshb, are you asking if the ASP code will show up as HTML in the resulting HTML file? If thats the case, the answer is no. There is a 'IF' to that though. It will only be processed as ASP if the page knows that it's ASP... as in the example that I posted earlier in this topic.

With the shopping cart templates and headers you can do that because the HTML template file is actually being processed as part of an ASP page (all files in the cart are .asp and anything .html is included or called somewhere in those ASP pages). Thats the only way you can include ASP in an HTML file and get it to work. If you had some ASP code in an HTML file and opened that HTML file directly in your browser, the ASP code would be rendered as HTML and nothing more. When its inside the cart however, (a.k.a. being called from an ASP page) that's an entirely different story and will result in the ASP code being rendered as such.

Does that answer your question or did I misunderstand your question altogether?

All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page

devshb
Senior Member

United Kingdom
1898 Posts

Posted - January 30 2004 :  10:05:37  Show Profile  Visit devshb's Homepage  Reply with Quote
yep; you got it jonmadrid; congrats on managing to decode my question !

along similar lines....

so I guess that means that you can put asp code into something like the product-format template, and it'll get processed as if it's part of the main asp page, yes ?! I guess it depends on how/when the asp code is parsed once it gets read by the product-template-reading/writing function, maybe in this instance it's too many steps for the secondary asp to be parsed. (totally separate but similar subject from the generated-htmls, this is)

If someone manages to understand that horribly convoluted/badly-phrased question (and even better, manages to answer), then I'll be very impressed!

Go to Top of Page

jonmadrid
VP-ASP New User

USA
192 Posts

Posted - January 30 2004 :  11:24:26  Show Profile  Visit jonmadrid's Homepage  Reply with Quote
Well, any code in the product-format template for example is not really 'secondary' as you called it. At least the ASP engine won't think so. It just processes anything that comes in its path. Take a look at the top of shop$db.asp for example. You'll see a bunch of included files that are processed on the fly along with the code right there within the shop$db.asp file. Some of those included files have files included with them, and so on for a couple of steps in some cases. The ASP engine just processes whatever its told to process.

I think what you're getting at or understand is dynamic content and data... Something that changes based on different variables. In the case of the product-format template you could indeed include some ASP code that would be processed when the page is loaded. I did exactly that for a client just recently. I wrote a sub routine in the logic in the shop$db.asp file which created a table of products for depending on the category the cusomter is veiwing. That sub routine was just 'called' on different pages and depending on the circumstances (category being viewed, category that product being viewed belongs to, etc) the contents of the generated table will be different.

Make sense?

All the best,

Jon Madrid
--------------------
Madrid Communications
Web Design, Development, and Hosting
www.madridcom.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000