Can I create a different template for each area of the site?

Yes!  The default method of our system uses a primary master template named templates/default.wc.  That was the basic idea behind our CMS.  You could simply use one page and that page would be used on every other page throughout a user experience.  As you have read in previous articles, our files are HTML, but we save them as .wc and .wws to tell the webserver that they need to be passed through our CMS engine. Files with the extension .htm or .html will be rendered as plain HTML files.

Let's say you want to create your only landing page.  You would create a file like landingpage.wws, and store it in your templates folder.  You could add these two tags at the top.

<%= Process.oView.Set("CurrentArea","USER") %>
<%= Process.oView.Set("DefaultTemplate","D:\inetpub\CLENTID\ORDERNUMBER\templates\blank.wc") %>

The clientid and ordernumber would be replaced with real values of course to work.

If the two lines above are placed in a file called landingpage.wws, the page would use a master template called 'blank.wc'.  If that file does not exist, of course nothing happens.  If it does exist it needs the tag <%=pclist%> inside of it.  That tag will render additional content from the system directly where you put it.  More about this later.

So by doing the above, you essentially 'turn off' using the default.wc because you created a 'user' page that uses blank.wc as the master template.

The system also has what are called 'view areas'.  Each view area has its own master template capability.  The area corresponds to the template name it supports.  So if you want a different template for the catalog area, create templates/catalog.wc, if you want one for checkout then create templates/checkout.wc.  The system will not need the tags above for these 'system' view areas that you see below.  The system will automatically look for view areas and template files with the names below (add .wc as the file extension).

ADMIN
CATALOG
CHECKOUT
CUSTOMERSERVICE
DEFAULT
PARTDETAIL
PARTLISTING
PICKUP
RETURN
SECURE
SEO
SHOPPINGCART
When using this feature it is important to have a plan. Your default.wc should be using the 'include' features so that you can maintain consistency and keep things easy to edit. For example, most of our sites will have a page in templates called section-header.wc. This is of course the 'header' of the page. Most of your pages will want to use the same header. One example of having a different header might be the home page. You might not want to run a Leaderboard advertisement on the home page, but you want to run it on every other page or section of the site. You could accomplish this by creating a section-header-home.wc template and including it in the home page and then using section-header.wc template in the rest of your pages and 'areas'.
 
 
Was this answer helpful? 0 Users Found This Useful (0 Votes)