News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Please Add This (Code Attached)

Started by PRO, November 15, 2011, 20:47:32 PM

Previous topic - Next topic

PRO

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>

stinga

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!.
Stinga.
614869 products in 747 categories with 15749 products in 1 category.
                                             Document Complete   Fully Loaded
                Load Time First Byte Start Render   Time      Requests      Time      Requests
First View     2.470s     0.635s     1.276s          2.470s       31            2.470s      31
Repeat View  1.064s     0.561s     1.100s          1.064s       4             1.221s       4

PRO

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