Support Forums

Customization of Extra Fields

This is a discussion on Customization of Extra Fields within the Pre Sales Questions forums, part of the Pre-Sales & Testimonials category; Hi folks, First post here, from a web designer/developer with intermediate PHP/MySQL experience. I'm pretty sure I'll be making a ...


Go Back   68 Classifieds Forums > Pre-Sales & Testimonials > Pre Sales Questions

Reply
 
Thread Tools Display Modes
Old 05-28-2009, 08:12 PM   #1
Junior Member
 
Join Date: May 2009
Posts: 7
Rep Power: 0
quasi888 is on a distinguished road
Default Customization of Extra Fields

Hi folks,

First post here, from a web designer/developer with intermediate PHP/MySQL experience. I'm pretty sure I'll be making a purchase of the Developer version for a project I'm about to start. I do have a few questions regarding customization of Extra Fields.

I am going to need to add two additional parameters to the Extra Fields. (I guess you could say I want to add extra fields to Extra Fields!) Specifically, they will be as follows:

Category - This will allow me to programatically group multiple related Extra Fields together under a common subheading on both the Search and Listing Detail pages. (Of course, this would imply that I also need to create a new database table consisting of Extra Field Categories.) For example, if we are talking about a listing for a motorcycle, I could place the extra fields for fork travel, fork oil weight, fork spring rate, etc. under the heading of 'Suspension'. (OK, that's not a very good real-world example of what would be included in a motorcycle ad, but hey, I'm a moto fanatic. ) When I render the page, I want to iterate over the field categories. Within each category, I want to display the category name, and then iterate over the extra fields associated with it.

Description - This would be a VARCHAR or TEXT field that is a description of the field itself. It would be displayed like a help/tooltip balloon when the user mouses over an icon next to the field name.

So, in summary, I would need to add two new fields to the extra fields table, one of which would need to reference the ID in a 'extra_fields_category' table which would need to be created.

I know my way around MySQL and PHP adequately (still a bit weak in the object-oriented stuff, but I'm getting there), but just wanted to make sure I could make these schema changes to the database without fear of breaking something in the codebase.

Thanks in advance!
quasi888 is offline   Reply With Quote
Old 05-28-2009, 08:45 PM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,413
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Im not sure I am totally following what you want to do but let me see if I can explaine extra fields a bit more and maybe you can connect the dots.

Extra fields are by default associated with a category type. You create them via the admin interface so you dont have to worry about database data column types etc. 68C has predefined field types (ie text, date etc) and it handles the specifics.

Since extra fields have a relationship to categories and each category can have different extra fields AND there are different TYPES of extra fields things get a bit complex.

Extra fields are actually made up of 3 different database tables, fields, fieldsbindings and fieldsoptions.

fields holds the field id, name etc, basically the things you see on the page when you create the extra field.

fieldsbindings basically has the fieldID and the categoryID that the field belongs to

and fieldoptions actually holds the value the user enters and site visitors see.

So, with the above in mind, im not sure if your approach would be the best way of going about it. Personally I think modifying the default tables is a very bad idea because you risk making upgrades to the script difficult to impossible.

Its common for people who have not seen the code to make assumptions and about what they want to do and often that leads to frustration because they try and work outside of the framework that already in place.

If I am understanding you correct, I think what I would do is create all the extra fields and then simply replace the default extra field collection and display code with my own that incorporates grouping the extra fields as needed.

For the "help" or "tool tip" text, I would simply make use of overlib which is already used by 68C and hard code the help into the redone code to display the grouped extra fields.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 05-29-2009, 05:40 AM   #3
Junior Member
 
Join Date: May 2009
Posts: 7
Rep Power: 0
quasi888 is on a distinguished road
Default

Larry -

Thanks for the response. It was perfectly clear, even if my original explanation may not have been.

Your proposal of simply customizing the display code is clearly the path of least resistance -- especially since all the extra fields I will be adding will be common to ALL product categories. Unfortunately I am as guilty as any of not being able to see the forest for the trees at times.

Thanks again.

Dave
quasi888 is offline   Reply With Quote
Reply

Tags
customization , database , extra fields

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extra fields seymourjames Technical Support 10 04-11-2008 02:39 PM
V4 Extra fields gppromano Technical Support 10 07-02-2007 06:28 PM


All times are GMT -4. The time now is 10:18 AM.


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