VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: PRO on November 15, 2011, 20:47:32 PM

Title: Please Add This (Code Attached)
Post by: PRO on November 15, 2011, 20:47:32 PM
This is for SEO page title control of the category. This will allow you to set the page title to something different than the category name.

Category Table SQL
ADD
Column Name  customtitle
Length 70
Default NONE

NEXT

virtuemart/views/category/view.html.php

CHANGE this
$categoryStripped = strip_tags($category->category_name);

to this
if ($category->customtitle) {
         $categoryStripped = strip_tags($category->customtitle);
      } else {
      $categoryStripped = strip_tags($category->category_name);
      }



Language String Add:
COM_VIRTUEMART_CATEGORY_TITLE="Custom Category Title"

ADD the Field To The Category Edit Form

<tr>
                  <td class="key">
                     <label for="customtitle">
                        <?php echo JText::_('COM_VIRTUEMART_CATEGORY_TITLE'); ?>
                     </label>
                  </td>
                  <td>
                     <textarea class="inputbox" name="customtitle" id="customtitle" cols="35" rows="5"><?php echo

$this->category->customtitle; ?></textarea>
                  </td>
               </tr>
Title: Re: Please Add This (Code Attached)
Post by: stinga on November 17, 2011, 12:38:28 PM
G'day BT,

Why do you need to strip_tags on a title? (just in case?)
Why 35 cols by 5 rows and a varchar of 70?

Must have a look for all the strip_tags on our site and remove those that are not needed, on category_name for instance, might make it go a bit faster!.
Title: Re: Please Add This (Code Attached)
Post by: PRO on November 17, 2011, 14:12:02 PM
Quote from: stinga on November 17, 2011, 12:38:28 PM
G'day BT,

Why do you need to strip_tags on a title? (just in case?)
Why 35 cols by 5 rows and a varchar of 70?

Must have a look for all the strip_tags on our site and remove those that are not needed, on category_name for instance, might make it go a bit faster!.

Strip tags were already there for Page Title, so I left it there.
Varcharacter , NO, Text (I believe).
Column size and rows doesnt really matter. But 70 length Is good