User Tools

Site Tools


faq:ecomm_category_headers

Efficient way to display Category Title Headers

<ww:if(<ww:file_exists filename="content/<ww:category_number>.html">)(
	<ww:include_file filename="<ww:category_number>.html" default="generic.html" />
)
else()>

The above code will search for a HTML file in the “content” directory named after the “category number” from System Five and insert it, if it cannot find the file it will display generic.html

Using this method is much more efficient compared to the traditional method shown below.

Below is the old method of doing this.

<ww:if('<ww:category_number>'=='100')(text goes here)else(
<ww:if('<ww:category_number>'=='200')(Text goes here)else(
<ww:if('<ww:category_number>'=='700')(Text goes here)else(
<ww:if('<ww:category_number>'=='600')(Text goes here)else(
<ww:if('<ww:category_number>'=='300')(Text goes here)else(
<ww:if('<ww:category_number>'=='800')(Text goes here)else(
<ww:if('<ww:category_number>'=='400')(Text goes here)else(
<ww:if('<ww:category_number>'=='143')(Text goes here)else(
<ww:if('<ww:category_number>'=='900')(Text goes here)else(
<ww:if('<ww:category_number>'=='430')(Text goes here)else(Generic text)>)>)>)>)>)>)>)>)>)>
faq/ecomm_category_headers.txt · Last modified: 2009/12/31 15:31 by eugene