Miva 5.5 Trick Custom Category Page Titles

Recently I've been upgrading some miva merchant 4.24 stores to miva 5.5. A somewhat daunting task to be sure. The store morph template technology is very nice, very welcome and has the potential to be extremely handy - if only there were better documentation.

I mean, maybe module writers know how to call this and that variable without help, but I need more info. I'm a web designer, not a programmer. Detailed info on parameters and variables and elements and commands would be everso helpful. Guessing isn't much fun.

Every time I google what I want, no relevant results come up. One might blame the search engine, but one would be incorrect. A visit to the mivamerchant site isn't any more insightful. There simply isn't a good user manual. How am I supposed to RTFM when none exists?

I did however, come up with a neat trick. I wanted custom page titles that were different from the category titles. But I needed a conditional so that if I hadn't filled in the custom title space the original category title would still apply. I'm referring to the meta title in the head of html documents. Extremely important SEO wise. I wanted shorter, more person friendly category tree links and the ability to have more informative and keyword rich document titles.

I tried a lots of ideas, but the one that finally worked was using the miva category title image box.

The code for it was already in the page template, including a prewritten conditional statement for whether it's null. Perfect. I don't need miva's help to add an image to the top of the page anyway. The category header can easily server that purpose. So I will use this variable to house my custom category titles.

I simply selected and cut the entire if has category title image statement from its original location in the CTGY page template and pasted it into the head title tag. I then editted it so the img src part was gone and only the text of it would remain. And I added an else with the actual category name for all those categories that didn't have any text in the category title image field.

<title><mvt:if expr="NOT ISNULL l.settings:category_title:image">

Now when I want a custom page title for any category I simply input the desired text into the category title image box. Easy peasy.