WebvantaScript Cheat Sheet

The code below is deprecated and should not be used in new designs.

< Main Cheat Sheet

Deprecated

<w:stylesheet_webvanta>

No longer needed. Now is a "no-op".

<w:kb:category>

Set the category context using a category ID extracted from the URL, when page type is "Category".

Example

Usage Example:

<w:kb:category>
  <h1><w:name /></h1>     <!-- category name -->
  <w:kb:item:each category="current"> 
     <h2><w:name /></h2>  <!-- item name -->
  </w:kb:item:each>
</w:kb:category>

Set the category context according the the ID in the page's URL. Display the category name, and list all the items of any type that are in this category. Must be on a page whose page-type is set to Category.

<w:javascript_webvanta>

No longer needed. Now is a "no-op".

<w:kb:category:each relative="item">

Iterate through each of the categories to which the current item is assigned.

Example

Usage Example:

<w:kb:item>
  <h2>Categories:</h2>
  <ul>
    <w:kb:category:each relative="item">
      <li><w:name /></li>
    </w:kb:category:each>
  </ul>
</w:kb:item>

List all of the categories assigned to the current item. Must be used on an Item page.

<w:kb:item>
  <h2>Categories:</h2>
  <ul>
    <w:kb:category:each relative="item" filter="Boats">
      <li><w:name /></li>
    </w:kb:category:each>
  </ul>
</w:kb:item>

By adding a filter parameter to the iterator, you can limit the categories listed to those that are subcategories of a specified category (Boats in this example).

<w:javascript_ajax>

Loads Prototype and Scriptaculous JavaScript libraries. Used in older Webvanta templates, but now replaced by jQuery.

<w:if_subcategories>

Include the following code only if the current category has subcategories.

Example

Usage Example:

<w:kb:category:each>
  <w:if_subcategories>
    <p>The category <w:name /> has subcategories.</p>
  </w:if_subcategories>
  <w:unless_subcategories>
    <p>The category <w:name /> has no subcategories.</p>
  </w:unless_subcategories>
</w:kb:category:each>

Display different text depending on whether the current category has any subcategories. Often useful to display local navigation.

<w:tag:each>

Iterate through each of the tags.

<w:kb:category:if_items type="item-type">

Includes following code only if there are one or more items of the specified type in the current category.

Example

Usage Example:

<w:kb:category name='web design resources'>
  <w:kb:category:if_items type="blogs">
    <p>We have <w:count /> blogs in the <w:name /> category.</p>
  </w:kb:category:if_items>
</w:kb:category>

Show the number of blogs in the web design resources category.


              

<w:rfc1123_date />

Provides the date in RFC-1123 format, for use in RSS/Atom feeds.