Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Problems with BCSE Category Title Plugin

 
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4
 
Thread Tools
  #1  
Old 03-27-2008, 01:03 AM
 
GeeCee GeeCee is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 111
 

Question Problems with BCSE Category Title Plugin

I tried to install the BCSE Category Plugin from here: http://bcsengineering.com/store/customer/product.php?productid=161&cat=7&page=1

But the installation instructions appear to have caused a problem: now all product pages have the same title as their Category. This is how my home.tpl currently looks:

Code:
<title>{strip} {*BCSE Begin*} {if $page_data.metatitle} {$page_data.metatitle} {else} {*BCSE End*} {*BCSE Begin*} {if $cat and $current_category.meta_title and not $smarty.get.productid} {$current_category.meta_title} {else} {*BCSE End*} {if $main eq "catalog" AND $current_category.categoryid eq ""} {$lng.txt_site_title} {else} {capture name=title} {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {if not %position.first%}&nbsp;|&nbsp;{/if} {$location[position].0|strip_tags|escape} {/section} {else} {section name=position loop=$location step=-1} {if not %position.first%}&nbsp;|&nbsp;{/if} {$location[position].0|strip_tags|escape} {/section} {/if} {/capture} {if $config.SEO.page_title_limit <= 0} {$smarty.capture.title} {else} {$smarty.capture.title|replace:"&nbsp;":" "|truncate:$config.SEO.page_title_limit|replace:" ":"&nbsp;"} {/if} {/if} {/if}{*BCSE Added*} {/if}{*BCSE Added*} {/strip}</title>

I believe the problem is with the 2nd IF:

{if $cat and $current_category.meta_title and not $smarty.get.productid}

because if I comment this out, the product details pages show their correct title. It appears that this IF is evaluating true for product pages, and it shouldn't be, but I don't know enough about how these variables get set, to know what to change. I would hazzard a guess and say that this is the problem: and not $smarty.get.productid as it appears the intention here is to exclude product pages.

On a more general note, my <Title> is a rather confused mess now, with several different mods overlapping. Anyone got a better way of laying all this out?

Many thanks,
__________________
X-Cart Gold v4.1.10
Manchester, UK
Get SEO, PPC or just advice from Intrinsic Marketing
Reply With Quote
  #2  
Old 03-27-2008, 03:18 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Problems with BCSE Category Title Plugin

Moving to Third Party Add-Ons
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 03-27-2008, 06:29 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Problems with BCSE Category Title Plugin

Try:

{if $current_category.categoryid and $current_category.meta_title and not $smarty.get.productid}
Reply With Quote
  #4  
Old 03-27-2008, 07:59 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,074
 

Default Re: Problems with BCSE Category Title Plugin

Quote:
Originally Posted by Jon
Try:

{if $current_category.categoryid and $current_category.meta_title and not $smarty.get.productid}

Let us know if Jon's suggestion does or doesn't work! We will update the code if it does work. Possibly an incompatibility with the latest 4.1.x

Thanks,

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #5  
Old 03-27-2008, 08:40 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default Re: Problems with BCSE Category Title Plugin

A better solution would actually be:

{if $current_category.categoryid and $current_category.meta_title and not $product.productid}
Reply With Quote
  #6  
Old 03-27-2008, 08:41 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,074
 

Default Re: Problems with BCSE Category Title Plugin

Quote:
Originally Posted by BCSE
Let us know if Jon's suggestion does or doesn't work! We will update the code if it does work. Possibly an incompatibility with the latest 4.1.x

Thanks,

Carrie

We've updated the code. Please use this instead:
{if $current_category.categoryid and $current_category.meta_title and not $product.productid}

This is compatible with CDSEO.

Thanks,

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #7  
Old 03-27-2008, 08:45 AM
  BCSE's Avatar 
BCSE BCSE is offline
 

X-Guru
  
Join Date: Apr 2003
Location: Ohio - bcsengineering.com
Posts: 3,074
 

Default Re: Problems with BCSE Category Title Plugin

Ha
looks like Jon and I posted at the same time.

Our files are updated to be compatible with his CDSEO code.

Carrie
__________________
Custom Development, Custom Coding and Pre-built modules for X-cart since 2002!

We support X-cart versions 3.x through 5.x!

Home of the famous Authorize.net DPM & CIM Modules, Reward Points Module, Point of Sale module, Speed Booster modules and more!


Over 200 X-cart Mods available & Thousands of Customizations Since 2002 - bcsengineering.com

Please E-Mail us for questions/support!
Reply With Quote
  #8  
Old 03-27-2008, 11:12 PM
 
GeeCee GeeCee is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 111
 

Default Re: Problems with BCSE Category Title Plugin

> {if $current_category.categoryid and $current_category.meta_title and not $product.productid}

That's done it, thanks for the quick turn around.
__________________
X-Cart Gold v4.1.10
Manchester, UK
Get SEO, PPC or just advice from Intrinsic Marketing
Reply With Quote
  #9  
Old 03-28-2008, 12:48 AM
 
GeeCee GeeCee is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 111
 

Default Re: Problems with BCSE Category Title Plugin

As a slight aside, the programmer in me is not liking the structure of this code now. Lots of nested IF's are never pretty, is there no SELECT CASE type structure I could use instead?

Either way, the code would be more efficient if the most commonly implemented item was the first logical step in the IF, with the least commmon condition last. Currently the tests go in this order:

- The first IF checks for static pages
- followed by category pages
- then the home page
- finally product pages.

I would have thought that testing should more correctly go in this order:

- Home page
- Category page
- Product page
- Static page

So how about something like this:

Code:
<title>{strip} {*CAM Check for home page*} {if $main eq "catalog" AND $current_category.categoryid eq ""} {$lng.txt_site_title} {else} {*CAM Check for Category page *} {if $current_category.categoryid and $current_category.meta_title and not $product.productid} {$current_category.meta_title} {else} {*CAM Check for Static page*} {if $page_data.metatitle} {$page_data.metatitle} {else} {*CAM Must be product page*} {capture name=title} {if $config.SEO.page_title_format eq "A"} {section name=position loop=$location} {if not %position.first%}&nbsp;|&nbsp;{/if} {$location[position].0|strip_tags|escape} {/section} {else} {section name=position loop=$location step=-1} {if not %position.first%}&nbsp;|&nbsp;{/if} {$location[position].0|strip_tags|escape} {/section} {/if} {/capture} {if $config.SEO.page_title_limit <= 0} {$smarty.capture.title} {else} {$smarty.capture.title|replace:"&nbsp;":" "|truncate:$config.SEO.page_title_limit|replace:" ":"&nbsp;"} {/if} {/if} {/if} {/if} {/strip}</title>

Ok that's not quite what I was hoping for as it checks for the static page before the product page.

I'm also not sure what the section that starts {if $config.SEO.page_title_limit <= 0} does, and whether that should be outside of the Product Page IF block, as currently that doesn't get run for the home page, category pages or static pages.

Sorry, I'll stop my rambling now.
__________________
X-Cart Gold v4.1.10
Manchester, UK
Get SEO, PPC or just advice from Intrinsic Marketing
Reply With Quote
  #10  
Old 03-31-2008, 07:34 AM
 
sandyscloset sandyscloset is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 43
 

Default Re: Problems with BCSE Category Title Plugin

GeeCee thanks for this thread because I have been trying to figure out why my products had the category titles instead of the product titles. Fix is today.
__________________
www.sandyscloset.net/home.php/Gold
xcart gold - 4.1.10
X-AOM, DSEFU, X-cart Site map, Firetank's Featured Product Manager and Feedmanager Bundle, BCSEnginneering Product Meta Tags Plus, Category Meta Title Control, Static Page Meta Tag Control, and Variant Modifier,

Hosting by EWD Hosting
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Third Party Add-Ons for X-Cart 4



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 06:07 PM.

   

 
X-Cart forums © 2001-2020