68 Classifieds Forums
Go Back   68 Classifieds Forums > v3.1.x Help & Support > v3.1 Questions & Support > Show name of category in viewlisting
v3.1 Questions & Support Help and support for 68 Classifieds v3.1.x

 
Thread Tools Display Modes
(#1)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default Show name of category in viewlisting - 01-08-2007, 02:03 PM

Hi,

I'm trying to show the name of the current category (not the numerical value) on viewlisting.tpl.php but haven't been successful in finding it.

It looks like I'll need to alter viewlisting.php to pull the value out of the db and assign it to a variable so I can display it -- what is it stored as in the db?

Thanks


V3.1.5b Developer
Reply With Quote
(#2)
Old
Lhotch Lhotch is offline
Moderator
Lhotch has a spectacular aura about
 
Posts: 1,466
Join Date: Mar 2006
Default 01-08-2007, 02:45 PM

Not sure I am following ya. In the default template, right at the top of the listing itself it shows a breadcrumb with the category the listing is in.
Reply With Quote
(#3)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default 01-08-2007, 03:29 PM

Hi Larry,

I have a need to use the category name (it's actually a city name in my application) elsewhere on the page.

The breadcrumb variable {$entry} includes a link to the category display page. I need just the word itself, without the hyperlink. Debug doesn't reveal any variables containing this, so I'm guessing I need to create one. Am I correct?

Regards,
Jim


V3.1.5b Developer
Reply With Quote
(#4)
Old
Lhotch Lhotch is offline
Moderator
Lhotch has a spectacular aura about
 
Posts: 1,466
Join Date: Mar 2006
Default 01-08-2007, 03:54 PM

You could loop through each element of the breadcrumb and assign the value to a variable, each iteration will overwrite the last until you get to the end and then the variables value will be equal to the category your in, then you can display the value.

You could include the following smarty near the top of your viewlisting.tpl.php file to get the value and assign it to the smarty variable "category"

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

then just use the following in your template where you would like the category displayed....

{$category}
Reply With Quote
(#5)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default 01-08-2007, 03:59 PM

That did it, Thanks so much!


V3.1.5b Developer
Reply With Quote


Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Show customers URL on showlistings.tpl.php marketingsolutions v3.1 Questions & Support 0 11-01-2006 08:38 PM
Show the visitors which category has new ads pat01 v3.1 Modifications 7 07-28-2006 01:25 AM
Show image #1 large on viewlisting page macagent v3.1 Modifications 4 07-12-2006 04:56 PM
Additional ViewListing Info based on category free2take v3.0 Modifications 5 05-03-2006 05:36 PM
Category fields in view list Lagniappe v3.0 Questions & Support 2 04-19-2006 09:09 AM



Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2007, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com