|
SUPPLIER RECORDSSuppliers are the entities one creates specifically to indicate the "source" of Items. If you allow Members to submit their own Items, then you can either REQUIRE that they create at least one Supplier account, and associate each submitted Item with a Supplier, OR you can allow them the OPTION of submitting without an associated Supplier, OR you can delegate the creation and assignment of Suppliers to either Admin or an Editor and require that your members submit Items WITHOUT an associated Supplier. The first option is preferrable when your members are likely to want to set themselves up as "vendors" and submit "vendor" Items. The last option might be more useful if you want members to submit Items but you do not want them to litter your site with Supplier accounts. The second option allows for a middle ground. When a member creates a Supplier account they create a record in your Supplier table. You can, however, also add your own Supplier accounts, or you may just use one such account to associate with all the Items that you personally enter into the database. Or you might not associate any Suppliers with the Items you create. Items without Suppliers are fine, too. Once you have entered a Supplier into the Supplier table, and it has been allocated a Supplier ID of, say, 5, then you can navigate to the Supplier profile page via the browsable Yellow Pages (if it is not listed on any specific page you can always look up the Supplier alphabetically), or you can enter the URL to the Supplier profile page directly into your browser, like so: http://www.mydomain.com/cgi-bin/path/to/... /redqueen/do/redqueen.cgi?module=profile_supplier&supplier_id=5 Creating a SupplierAs with the other "Creating a Thing" pages in this documentation, we cover here the procedure associated with adding a Supplier from the Database control panel, though you can also use the Yellow Pages Browser in the admin area to create records. If you're not sure how to get to the Database control panel, see Creating an Item. From the Database menu on the Database control panel, select "Add" for the action and "Supplier" for the table. Click on the submit button to have the right frame load. You'll then see the following form elements (example input values have been added for clarity, and are explained below):
Editable Supplier FieldsThe following Supplier fields appear both on the Add Supplier and Modify Supplier pages, however three fields displayed above--Member ID, Stickiness, and Is Validated--only appear when the Administrator is logged in.
Supplier ID
Member ID
Supplier Name
Brief Description
Supplier Description
Homepage
Logo
Image
Contact Email
Contact Name
Contact Phone, Contact Fax
Street, City, Postal/ZIP code
State (if in U.S.)
Region (non U.S.)
Country
Stickiness
Is Validated
Solicit Reviews
Editable Non-Supplier FieldsIn addition to the Supplier fields shown above, there may be other non-Supplier fields which appear on the Add Supplier and Modify Supplier pages. Yellow Page Editors and the Administrator are able to modify the Yellow Pages associated with a Supplier, so an extra form element will be present to handle this and will look something like the following (this demo form element is functional so you can play with it):
To assign a Yellow Page to the Supplier, select the Yellow Page from the pool in the lower part of the form element and click on "Assign Yellow Page" to pull it from the pool. To unassign a Yellow Page, select it from the list of assigned Yellow Pages in the top part of the form element and click "Return to Pool". When you finally submit the Supplier record the new Yellow Page assignments will also be recorded. Note: You will discover if you try to remove all Yellow Pages from a Supplier record that you cannot do it. At least one Yellow Page will remain. This behavior may or may not change in the future. On the other hand, if a Member attempts to remove one of their Supplier accounts from a given Yellow Page via the public interface, they will have no problem doing so. Note also that these forms are only present when editing records via the Database control panel. If you are using the Yellowpage Browser to add and edit records, look for the Copy link that appears next to each supplier in a yellowpage listing. You can copy the supplier to another yellowpage using point and click operations. But you can only do this for one yellowpage at a time. Dealing With Thousands Of Supplier AssociationsLike the situation involving Item/Category associations, there is an obvious limitation to the placement of a form on the page which allows the specification of Yellow Pages for a Supplier. If you have thousands of Yellow Pages in your database, the form will take a very long time to load in your browser. It may even crash your browser if sufficiently large. If this is the situation you face, you should instead elect to use the Yellow Page Browser to perform Supplier-related database additions and modifications (though for the most part you will probably leave this to the Members themselves). When you use the Yellow Page Browser you will find the potentially troublesome Yellow Page form has been removed. Instead, to modify the Yellow Page associations for a Supplier, you will find specific links to do so next to the Supplier within a Yellow Page Listing. Adding New Supplier FieldsIf you need to add extra fields to the Supplier table you can do this. Red Queen lets you add columns to any table that has a PRIMARY KEY. Each of these tables is listed in the Database menu found on the Database control panel. The Supplier table, of course, is one of them. For detailed information on the process of adding columns to existing tables, see ADDING COLUMNS TO A TABLE. Do keep in mind when you add columns to the Supplier table that these new columns should probably have the Not Null attribute set to "No", so that the field can be regarded as OPTIONAL by Members. Otherwise, if a Member MUST supply the value, set the Not Null attribute to "Yes". When it comes to displaying an optional Supplier field in the templates it is not difficult to test for the existence of the column value before attempting to display it. For example, if you add an optional Supplier.established column, representing the first year the Supplier was open for business, you can test for the value with something like this: [% supplier = alias.supplier_info %] [%# assuming alias.supplier_info is passed into the template %] Established: [% IF supplier.established %] [% supplier.established %] [% ELSE %] year not provided... [% END %] Here alias.supplier_info is the hash of Supplier information passed into the Template-Toolkit template that we are using to display the information, such as the template for the Supplier detail page. You should note that extra fields added to the Supplier table will automatically appear on the Supplier Profile page, so you need take no special action there after adding a new column. A more detailed discussion of how to extract information from new columns is available in the sections entitled Adding New Item Fields and Understanding The Table Definition. The discussion in those 2 sections, while it pertains to column additions made to the Item table, nevertheless can be applied directly to column additions made to the Supplier table (just mentally replace the word 'item' with 'supplier' while reading...). Suppliers also have a Supplier Profile associated with them. To include the information carried by new columns in the profile you'll need to edit the supplier_data.ttml template. Once you have studied the template it should become clear how to add tags to display the content of the new columns. If you need explicit instructions, consider reading the tutorial entitled HOW TO CREATE A GRAPHIC ARTIST REVIEW SITE which goes into the matter in great depth when consider how to add new columns to the Member table. Adding new columns to the Supplier table is done in an exactly analogous manner. « Table of Contents | Obtain Red Queen » Copyright © 2004 Random Mouse Software. All Rights Reserved. |