Category Manager
Copyright © 2005, William Weiland
Overview
This plugin module allows you to have multiple category templates in a single store. You can have a different template for every category in your store if you want. The template uses the standard store morph technology template editor in MIVA Merchant 5.
Initial Setup
1) In admin, click Add Modules link (fig 2)
2) Click the file upload button
3) Browse to find the catman.mvc file on your hard drive and upload (fig 3)
4) Click Add to add it to the domain
5) Then in admin click on the plus to the left of Stores
6) Click the plus to the left of your store name
7) Click on the word Utilities under your store (fig 9)
8) Check the box next to the Category Manager
9) Click Update
10) Click Pages link to get to the User Interface (fig 4)
11) Click Items link at the top of the User Interface page (fig 5)
12) Click the Add Item button (fig 6)
13) Enter catman for the code (fig 8)
14) Look up and scroll to the last page of items and Category Manager should be at the end of the list of items
15) Select Category Manager
16) Click the Add button to assign the module
17) FTP the asc.gif, desc.gif, right.gif, and left.gif to the mm5/graphics directory
18) You can create as many different templates as you need. You can use the built in ctgy page template to get started by copying it to the clipboard and then adding a new template in the module's admin in the store utilities menu and pasting the built in template into the new template's input. (fig 10)
19) See ctgytmp1.txt for an example of a single column category layout. See ctgytmp2.txt for an example of a three column category layout. See ctgytmp3.txt for an example of a line list category layout. Within these examples you will see the template code for the dynamic sorting controls and the pagination and totals display. Note: each of these example pages is a txt file and is missing the beginning <html> and ending </html> tags. Only add the ending </html> tag. (fig 12)
20) Once you create custom templates, you can assign them to categories. Go to the store's categories link and click it. Locate the category you want to assign the custom template to and click the edit button. Click the link at the top for Category Manager. Assign the applicable template. (fig 11)

Editing Requirements
1) You will add four lines between the <mvt:item name="html_profile" /> tag and the <head> tag at the beginning of the ctgy page template. Click the link under your store for pages. Click the edit for the ctgy page. Add these four lines between the two tags: (fig 7)

<mvt:item name="catman" param="display" />
<mvt:if expr="l.settings:catman:replaced">
<mvt:exit>
</mvt:if>

2) Next, click the Items link for the ctgy page. Scroll down to the catman item name and assign it to the page (fig 8).

Optional Category Breadcrumb Trail
You can include a breadcrum trail, e.g. Home > Software > Developer Bundles by inserting the following code in your custom category templates:

<mvt:item name="catman" param="trail" />
<mvt:if expr="NOT ISNULL l.settings:catman:trail">
<mvt:item name="fonts" param="ctgy_font">
<a href="&mvt:global:sessionurl;Screen=SFNT&Store_Code=&mvta:store:code;">
<u>Home</u></a>
<mvt:foreach iterator="trail" array="catman:trail">
<mvt:if expr="pos1 GT 1">
 > 
<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:trail:code;">
<u>&mvt:trail:name;</u></a>
</mvt:if>
</mvt:foreach>
</mvt:item>
</mvt:if>
<br><br>

Optional Sub-Category Navigation
You can include the sub-categories on the parent category page (to the right) by inserting the following code in your custom category templates:

<mvt:item name="catman" param="subcats" />
<mvt:if expr="NOT ISNULL l.settings:catman:subcats">
<table><tr>
<mvt:foreach iterator="subcats" array="catman:subcats">
<td align="left" valign="bottom" nowrap>
<mvt:item name="fonts" param="body_font">
<a href="&mvt:global:sessionurl;Screen=CTGY&Store_Code=&mvta:store:code;&Category_Code=&mvta:subcats:code;">
<u>&mvt:subcats:name;</u></a>
</mvt:item>
</td>
<mvt:if expr = "(pos1 MOD 3 ) EQ 0">
<tr>
</mvt:if>
</mvt:foreach>
</tr></table>
</mvt:if>

Note: If you want to display the category image (if there is one) you would use a conditional check for the image instead of just the line for the name like:
<mvt:if expr="l.settings:subcats:image">
<img src="&mvt:subcats:image;" border="0"></a>
<mvt:else>
<u>&mvt:subcats:name;</u></a>
</mvt:if>

Frequently Asked Questions
Q: I just upgraded to Merchant 5.5 and the templates look different.
A: In the templates change:
<mvt:item name="head" />
to
<mvt:item name="head" param="head_tag" />

Remove the <html> tag at the beginning as it is being added by the <mvt:item name="html_profile" /> tag in the main template.

If your category column has suddenly become wider, locate the line
<td align="left" valign="top" nowrap>
at the beginning of the category column. Remove the nowrap.

Still have a question?

Fig 1: Main admin screen

Fig 2: Add a new module

Fig 3: Upload the module to the server

Fig 4: Template page selection

Fig 5: Items list

Fig 6: Add a new item

Fig 7: Editing a template page

Fig 8: Assign a page item to the template

Fig 9: Assigning a module to the store

Fig 10: Entering template code in a custom category template's input

Fig 11: Assigning a template to a category

Fig 12: Screen shot showing the dynamic sorting and pagination controls