![]() |
Smarty help
Ok, this one is perplexing me - one of you Smarty gurus should be able to help. Using Firetank's featured product manager for some category-specific featured product groups. I want to call the template automatically based on the category name, so I use this in subcategories.tpl:
{include file="customer/fts_featured_products.tpl" group="`$current_category.category`"} Works great - except for categories with multiple words in them. The Firetank mod doesn't accept spaces for the group, just _ characters. So I need to replace any spaces in the Smarty variable with _. I've tried using |replace, but with Smarty inside Smarty it is getting a bit crazy and spitting out SQL errors. Any help? Thanks! |
Re: Smarty help
How about using the category ID instead?
|
Re: Smarty help
Because the client will have no clue what that is when they are adding 1000 of those to the featured product manager, and I'd hate to have to make them go back and forth each time to look it up :) Trust me, that was my first thought as well :)
|
Re: Smarty help
Try this:
{include file="customer/fts_featured_products.tpl" group="`$current_category.category`"|replace:' ':'_'} or else assign the value to the variable and then use it in the include like this: {assign var="catname" value="`$current_category.category`"|replace:' ':'_'} {include file="customer/fts_featured_products.tpl" group="`$catname`"} |
Re: Smarty help
Thanks Vetrivel, it was the closing quote after the current_category variable that I was missing - works great!
|
All times are GMT -8. The time now is 01:15 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.