Creating a Book Catalog in Joomla 1.5.x with FlexiContent CCK
Part 1 - Creating the Book Type and Fields
Introduction
This series of tutorials assumes you've successfully installed Joomla 1.5.x and FlexiContent 1.5.3c. It also assumes you've got at least one menu item setup and can access FlexiContent from the front-end of your site. For one of the fields you'll also need a download plugin, I used PhocaDownload but others will do fine. I also used another plugin for social bookmarking in a field called SexyBookmarks.
For this tutorial I created a series of categories for use in a typical book store much like that of Amazon. It consisted of a root Catalog category with subcategories for Books, Seminars, CD's, MP3's, DVD's, White-papers and Freebies. I also created a section of categories for the type of book or Genre the product belongs to. Then of course there is a series of Author categories.
The beauty of the FlexiContent CCK is that your item, be it an a article or not, isn't restricted to one category like in Joomla. I can create an item, select the primary category for that item and then select multiple sub-categories for that item to appear in.
Here's the hierarchy of categories I created for my catalog:
Create a New FlexiContent Template - Catalog
Templates in FlexiContent serve much the same purpose as those in Joomla, they display types of content to the user. Since we're going to be adding some specialized layouts to our Product Catalog later we need to duplicate the default template for our own use.
- If you haven't done so already, login to the Joomla Administration control panel of your site and access the FlexiContent Component control panel from the components menu.
- Click the Templates tab
- Click the icon on the right of the "default" template to duplicate it. We'll rework this template in a later tutorial.
- Type Catalog in the Duplicate Template field in the popup window.
- Click the Duplicate button. I repeated this again for Seminars which is another type I created later but you don't need to do that to follow this tutorial.
We now have a template we'll use later on to customize the look and feel of our catalog.
Create a New FlexiContent Type - Product
- Click the Types tab.
- Click the New button
- Type in Product in the Title field
- Select the Catalog template in the Item Layout drop-down in the Parameters group on the right.
- Click the Save button. I repeated this for Seminars and Authors which are two other Types I created for my needs but you don't need to do that to continue with this tutorial.
Now that we have our Product type setup, we can add some extra fields to it so we can display information that isn't normally part of Joomla.
Add New FlexiContent User Fields for the Product Type
A content creation kit (CCK) isn't much use if you can't add fields for specialized data entry. FlexiContent supplies several field plugins for use in creating different form items. Rather than create a specialized plugin facility, FlexiContent used Joomla's standard plugin architecture to add field types to the component. This means that anyone capable of creating a Joomla plugin can create a FlexiContent plugin.
- Click the Fields tab
- Select Product in the Type drop-down list on the right. At this point core fields that are part of the default type will be listed.
- Select User Fields in the Field type drop-down list on the right. At this point your list should be empty.
- Click the New button
- Type SKU in the Label field
- Type sku_number in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type Stock Keeping Unit in the Description field
- Select the Product in the Types field on the right
- Type in 30 for the Field size
- Click the Save & New button
- Type Author in the Label field
- Type author in the Name field
- Select FlexiContent - Select Multiple in the Field Type drop-down
- Type Product Author in the Description field
- Select the Product in the Types field on the right
- Click the Yes radio button next to the field labeled Use SQL Query
- Type in the following:
select id as value, title as text from #__categories where parent_id=41 and published=1 order by title;
Note that the 41 in the above query corresponds with the Authors category in my database and may differ from yours. - Type in 5 for the Field size
- Select Comma for the Field separator
- Click the Save & New button
- Type List Price in the Label field
- Type list_price in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type "The list price for the product" in the Description field
- Select the Product in the Types field on the right
- Type in 30 for the Field size
- Click the Save & New button
- Type Price in the Label field
- Type price in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type "The price for the product" in the Description field
- Select the Product in the Types field on the right
- Type in 30 for the Field size
- Click the Save & New button
- Type Image in the Label field
- Type image in the Name field
- Select FlexiContent - Image in the Field Type drop-down
- Type "The image for the product" in the Description field
- Select the Product in the Types field on the right
- Setup Thumbnail sizes at 600x600, 300x300 and 150x150. No Watermarks and Scale as the Processing Method.
- Click the Save & New button
- Type Bundled With in the Label field
- Type bundled_with in the Name field
- Select FlexiContent - Select Multiple in the Field Type drop-down
- Type "List of bundled items with this product" in the Description field
- Select the Product in the Types field on the right
- Click the Yes radio button next to the field labeled Use SQL Query
- Type in the following:
select c.id as value, c.title as text from #__content c where c.catid =44 and c.state =1 order by c.title
Note that the 44 in the above query corresponds with the Catalog category in my database and may differ from yours. - Type in 5 for the Field size
- Select Comma for the Field separator
- Click the Save & New button
- Type Featured Product in the Label field
- Type feature_product in the Name field
- Select FlexiContent - Checkbox in the Field Type drop-down
- Type "Is this product a Featured Product?" in the Description field
- Select the Product in the Types field on the right
- Type in the following:
featured::Featured Product::image.png
- Select Space for the Field separator on the Back-end, Line break for the front-end
- Click the Save & New button
- Type Cart Link in the Label field
- Type cart_link in the Name field
- Select FlexiContent - Weblink in the Field Type drop-down
- Type "The WebMarketingMagic cart link for the product" in the Description field
- Select the Product in the Types field on the right
- Click the Yes radio button next to the field labeled Allow multiple values
- Type in 50 for the Field size
- Click the Yes radio button next to the field labeled Allow custom link title
- Click the Yes radio button next to the field labeled Open in a new window
- Click the Save & New button
- Type Teaser Items in the Label field
- Type teaser_items in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type "Downloadable teaser items such as Table of Contents or first few pages of a Chapter" in the Description field
- Select the Product in the Types field on the right
- Click the No radio button next to the field labeled Display label
- Click the Yes radio button next to the field labeled Trigger content plugins
- Select phocadownload in the Specific plugins only list
- Click the Yes radio button next to the field labeled Allow multiple values
- Type in 50 for the Field size
- Click the Save & New button
- Type Social Links in the Label field
- Type social_links in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type "Social Networking Links from SexyBookmarks" in the Description field
- Select the Product in the Types field on the right
- Click the No radio button next to the field labeled Display label
- Click the Yes radio button next to the field labeled Trigger content plugins
- Select sexybookmarks in the Specific plugins only list
- Type the following in the field labeled Default value:
{sexybookmarks} - Type in 30 for the Field size
- Click the Save & New button
- Type ISBN in the Label field
- Type isbn_number in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type "International Standard Book Number" in the Description field
- Select the Product in the Types field on the right
- Type in 30 for the Field size
- Click the Save & New button
- Type Publisher in the Label field
- Type publisher in the Name field
- Select FlexiContent - Weblink in the Field Type drop-down
- Type "The publisher of the product" in the Description field
- Select the Product in the Types field on the right
- Click the No radio button next to the field labeled Allow multiple values
- Type in 50 for the Field size
- Click the Yes radio button next to the field labeled Allow custom link title
- Click the Yes radio button next to the field labeled Open in a new window
- Click the Save & New button
- Type Binding in the Label field
- Type binding_type in the Name field
- Select FlexiContent - Select in the Field Type drop-down
- Type "The binding format for the book, if applicable" in the Description field
- Select the Product in the Types field on the right
- Type the following in the field labeled Field elements:
hardcover::Hard Cover%% softcover::Paper Back%% binder::Spiral Bound
- Click the Save & New button
- Type Pages in the Label field
- Type num_pages in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type "The number of pages in the book" in the Description field
- Select the Product in the Types field on the right
- Type in 30 for the Field size
- Click the Save & New button
- Type Dimensions in the Label field
- Type dimensions in the Name field
- Select FlexiContent - Text in the Field Type drop-down
- Type "The overall size dimensions for the product" in the Description field
- Select the Product in the Types field on the right
- Type in 30 for the Field size
- Click the Save button
We now have all the fields needed for our product catalog. Next time we'll create a product using these fields.
- Tags: CCK, CMS, Content Creation Kits, Content Management System, FlexiContent, Joomla, Software Development


























Comments (0)