68 Classifieds Forums
Go Back   68 Classifieds Forums > v3.1.x Help & Support > v3.1 Questions & Support > Adding extra field to subcategories.tpl
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 Adding extra field to subcategories.tpl - 02-04-2007, 06:02 PM

I'm trying to show a couple of the extra fields on subcategories.tpl but can't figure out how to add the data from the {$extra} array into the variables so I can display them.

Does anyone know how?

Thanks


V3.1.5b Developer
Reply With Quote
(#2)
Old
juven14 juven14 is offline
Moderator
juven14 has a spectacular aura about
 
Posts: 1,702
Join Date: Mar 2006
Location: NJ/NYC Area
Default 02-04-2007, 08:13 PM

The only place extra fields are available with out modifying the core files is at viewlisting.php and its templates viewlisting.tpl.php viewlisting2.tpl.php


Regards,

John
mods.auscity.com
v3.1.5 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
(#3)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default 02-05-2007, 06:56 AM

Hi John,

With the developer edition I should be able to grab the data out of the database and display it, right?

I looked at viewlisting.php and took the section marked
//extra fields
and added it to category.php, but that didn't get the data in the $extra array like I hoped. $extra is now a template variable in category.php but it is empty.

What am I missing?

Regards


V3.1.5b Developer
Reply With Quote
(#4)
Old
juven14 juven14 is offline
Moderator
juven14 has a spectacular aura about
 
Posts: 1,702
Join Date: Mar 2006
Location: NJ/NYC Area
Default 02-05-2007, 09:22 AM

Well, you have to be sure you are calling the extra fields inside the loop where the listing information is assigned. This way it is availible for each listing.

Just to be sure we are on the same page, you are talking about adding extra fields to the results for category/toplistings/searchresults correct?

If you know the specific extra field and it is global across all listings you could modify the code found here to help you get it to the template. There isn't a very easy way of handling the dynamics of extra fields when you can have different ones for different categories and the fact that some pages show listings from various categories.

Code that does this for 3.0.15:
http://www.68classifieds.com/forums/...ead.php?t=2310

Original thread for this modification:
http://www.68classifieds.com/forums/...read.php?t=198


Regards,

John
mods.auscity.com
v3.1.5 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
(#5)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default 02-05-2007, 11:45 AM

Hi John,

The extra fields I need to display will be used for all products in all categories. I'm trying to display the extra fields in the category and subcategory display (showlistings.tpl). Debug shows the script is categories.php and the body is categories/subcategories.tpl.php.

I had already looked at the threads you referenced, but my php/mysql skills are very limited -- I can follow and edit some of the logic, cut and paste etc, but I've never grasped handling db I/O. I don't know what would need to be changed in the mods in those threads to make it work with 3.1.

I don't need the existing price and short description fields for the way I'm using the script, so I may use those fields for the two extra fields I need instead. That may be easier than pulling the extra array out of the db. I'll see how that goes...

Thanks


V3.1.5b Developer
Reply With Quote
(#6)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default 02-13-2007, 01:31 PM

I'm still short an extra field that I need to show in the category and subcategory display (showlistings.tpl).

How can I add entirely new field (or fields) to the db and make it available to show in the category templates? I can modify the templates to display them, I just need a bit of help getting the data in the variables.

Regards,
Jim Whitesell


V3.1.5b Developer
Reply With Quote
(#7)
Old
juven14 juven14 is offline
Moderator
juven14 has a spectacular aura about
 
Posts: 1,702
Join Date: Mar 2006
Location: NJ/NYC Area
Default 02-13-2007, 01:54 PM

This seems to be a pretty common request. I actually made a module for this but didn't want to release it since v4 is right around the corner. Since I'm feeling rather charitable I will attach it here when I get home from school.

However, it requires the developer version since some hooks have to be added and some code rewritten. We can just consider this a community module.


Regards,

John
mods.auscity.com
v3.1.5 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
(#8)
Old
HotAir HotAir is offline
Junior Member
HotAir is on a distinguished road
 
Posts: 20
Join Date: Jan 2007
Default 02-13-2007, 03:08 PM

Thanks John,

I'm looking forward to grabbing it --
Your generosity is greatly appreciated!!


Regards,
Jim Whitesell


V3.1.5b Developer
Reply With Quote
(#9)
Old
juven14 juven14 is offline
Moderator
juven14 has a spectacular aura about
 
Posts: 1,702
Join Date: Mar 2006
Location: NJ/NYC Area
Default 02-13-2007, 04:34 PM

Just got home, but I have to track down the core file changes. Seems the readme was never finished .

I'll need to upload it and be sure the rest was finished.


Regards,

John
mods.auscity.com
v3.1.5 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
Reply With Quote
(#10)
Old
juven14 juven14 is offline
Moderator
juven14 has a spectacular aura about
 
Posts: 1,702
Join Date: Mar 2006
Location: NJ/NYC Area
Default 02-13-2007, 06:15 PM

It has some errors, I thought I finished it, but there are some errors, maybe I will get to it tomorrow night.


Regards,

John
mods.auscity.com
v3.1.5 Developer

�By perseverance, study, and eternal desire, any man can become great.� George S. Patton
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
Enabled extra field and pdf file keeps "falling out" of previous listings sedonagate v3.1 Questions & Support 3 09-21-2006 08:50 PM
Adding an Extra Field that is clickable sporthorsebreeder Template Design Questions 12 09-04-2006 02:03 AM
Select field problem (extra field --> drop down list) pat01 v3.1 Questions & Support 1 08-10-2006 02:05 AM
Displaying extra field in Search and category listings Bucketman v3.0 Questions & Support 3 04-26-2006 09:48 AM



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