PDA

View Full Version : strip HTML from description?


dreamingdigital
09-06-06, 08:37 PM
Is it possible to have Miva do some magic and strip the HTML out of the description?

sebenza
09-07-06, 01:12 AM
What Screens? The Category and Product Template Managers can do it.

dreamingdigital
09-07-06, 04:51 PM
Awesome. That's what I need it on: the category screen, and I have your template module. Yesterday you helped me get this to work.

<mvt:item name="ctgytemplate" param="substring(l.all_settings:product:descrip, 1, 110)" />

Now my description is truncated to 110 characters. Now I just need to strip the HTML out of there. We'll see if that works OK. We're going to have to redo all our descriptions anyhow with the migration to Miva (old links in there) but getting rid of HTML would be awesome for my short descriptions I show on the category screen.

:)

sebenza
09-07-06, 05:24 PM
This will strip the html

<mvt:item name="ctgytemplate" param="substring(Strip_HTML(l.all_settings:product:descri p), 1, 110)" />

wcw
09-07-06, 06:10 PM
Have you though about using a custom product field for your short description. Often you can have a hard hitting bullet sentence or two that is much better than the first couple lines in your regular description. The advantage is you can use that same custom field for the meta tag description on the product page and the short description on the category page. Much better result than just trimming the first 110 characters of the description; just takes a little extra effort.

dreamingdigital
09-07-06, 06:18 PM
It's a band-aid solution for now but works like a charm. Writing content isn't my job since I have no idea really what all their hi-tech stuff is really about. lol. I'll have to pull somebody from their real job to do those tasks later, once the thing is working. The boss, of course, wants this site up asap, so I'm designing it so it works and looks decent but can be tweaked later with better written content.

Anywho, the Strip_HTML thing is cool. Saves me having to pull somebody from their post and copy-paste for a few hrs!! :)