Support Forums

category variable

This is a discussion on category variable within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Having a problem getting the category variable to not have spaces either side of it when displayed or assigned. This ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 08-26-2008, 05:40 AM   #1
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,765
Rep Power: 67
seymourjames is a jewel in the rough
Default category variable

Having a problem getting the category variable to not have spaces either side of it when displayed or assigned. This goes in the title tag and it is coming out something like <title> xxxxxx </title> and not <title>xxxxxx</title>

Here is the code I am using from the forum.

{foreach name=outer item=contact from=$breadcrumb}
{foreach item=item from=$contact}
{assign var=category value=$item|strip_tags}
{/foreach}
{/foreach}

Any ideas?
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is online now   Reply With Quote
Old 08-26-2008, 08:34 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,262
Rep Power: 129
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

use "strip".

http://smarty.net/manual/en/language.modifier.strip.php
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 08-26-2008, 09:45 AM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,765
Rep Power: 67
seymourjames is a jewel in the rough
Default

Thanks Larry - I will try that. Just saw it in the plugins and was wondering.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is online now   Reply With Quote
Old 08-26-2008, 11:06 AM   #4
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,765
Rep Power: 67
seymourjames is a jewel in the rough
Default

So I tried strip but it did not work

{foreach name=outer item=contact from=$breadcrumb}
{foreach item=item from=$contact}
{assign var=category value=$item|strip_tags}
{/foreach}
{/foreach}
{assign var=pagetitle value=$category|strip}


Category gets stripped of tags but then I need to strip off the remaining spaces around it so $pagetitle ends up clean.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is online now   Reply With Quote
Old 08-26-2008, 11:09 AM   #5
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,471
Rep Power: 130
Eric Barnes is just really nice Eric Barnes is just really nice
Default

How about this:
{assign var=pagetitle value=$category|trim}
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 08-26-2008, 11:24 AM   #6
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,765
Rep Power: 67
seymourjames is a jewel in the rough
Default

This works well. Thanks
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68 Classifieds
seymourjames is online now   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modification: RSS Feeds by Category (or anything else) jonahcoyote Modules / Plugins / Modifications 20 06-19-2009 12:16 PM
Display all ads and their category hel68c Modules / Plugins / Modifications 5 08-21-2008 04:36 PM
Header V3.0.15 newone Templates, HTML, CSS, and Design Help 17 05-05-2006 09:44 AM


All times are GMT -4. The time now is 06:08 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0