The Geek
06-05-2006, 08:35 PM
Here I am going to cover the basics of creating Custom Fields in GARS 2.0
Please note that this documentation was created for GARS 2.0 Beta 2. It may not be 100% up to date and things may change as future versions come out.
Step 1
Create a custom field
393
To create a custom field, click admincp->gars->custom fields->add new
Choose the type of custom field you want to create. Please note that you can not change the type after you created it - however you can always delete and create another!
Here is a quick overview of each type at time of writing this:
text - A one line text box.
Large text - a large text area
Whole number - A one line text box that only accepts whole numbers
Date selector - allows entering of dates
Single check box - um. Guess? That's right a single check box!
Check Boxes - allows you to create a group of tick boxes
Radio Buttons - Create a group of radio buttons
Select box - allows a drop down combo box.
Snipped URL - Allows users to enter in a URL, but display will be snipped after x amount of characters.
Thumbnail to original image - allows users to upload an image. When displayed, they only get a thumbnail that when clicked, will open the browser to the original image.
Thumbnail to URL - Allows user to upload an image which is thumb nailed. User also enters a URL. When you click on the thumbnail, it takes you to the URL.Once you choose which field type you want, you will be able to enter the settings for the field.
389
Title What you want to call it. It also appears above the custom field when a user is creating/editing their GAR
Description A short description for the field. It too appears above the custom field when creating/editing an item.
Display Order The, er - order it displays. A lower number makes it display earlier :)Other settings should be self explanatory. However I'm sure Ill be writing info on each type later.
Step 2
Assign the custom field to one or more types.
392
Edit the types you want to assign the custom field to (admincp->gars->types).
At the bottom of the page, you will see all available types that you can assign. Assign by ticking the box next to the custom field and clicking Save.
388
From that stage, the fields will be available when editing and creating a new GARS controlled thread.
Step 3
Displaying the values of your custom fields
Make sure you have the custom_fields.php module registered.
go to admincp->gars->modules
Check the bottom section (Registered modules) to see if you have Custom Fields there.
If not, then add it by clicking Register New Module and adding the following settings:
title: Custom Fields
file: custom_fields.php
templates: GARS_custom_container, GARS_custom_row,GARS_custom_date,GARS_custom_input ,GARS_custom_text,GARS_custom_textarea,GARS_custom _thumbnail
Then click Save.
This will make the custom fields module available to your module sets.
Step 4
Add Custom Fields to your module sets
390
Edit a module set making sure you are on the showthread page.
Scroll to the bottom of the page and in the left selection box, choose Custom Fields, then the position you want to place it.
Click Save and the Custom Fields module will be in position.
Edit the Custom Fields module settings page by clicking it's name (or by selecting edit from the drop down menu next to its name).
391
Here you can edit the title for the module box when it displays. You can also select which Custom Fields display along with an optional caption.
You can also overwrite the templates GARS uses to display the custom fields. Leave the template settings blank for the default.
[B]Viola!
394
Whoop there it is...
Please note that this documentation was created for GARS 2.0 Beta 2. It may not be 100% up to date and things may change as future versions come out.
Step 1
Create a custom field
393
To create a custom field, click admincp->gars->custom fields->add new
Choose the type of custom field you want to create. Please note that you can not change the type after you created it - however you can always delete and create another!
Here is a quick overview of each type at time of writing this:
text - A one line text box.
Large text - a large text area
Whole number - A one line text box that only accepts whole numbers
Date selector - allows entering of dates
Single check box - um. Guess? That's right a single check box!
Check Boxes - allows you to create a group of tick boxes
Radio Buttons - Create a group of radio buttons
Select box - allows a drop down combo box.
Snipped URL - Allows users to enter in a URL, but display will be snipped after x amount of characters.
Thumbnail to original image - allows users to upload an image. When displayed, they only get a thumbnail that when clicked, will open the browser to the original image.
Thumbnail to URL - Allows user to upload an image which is thumb nailed. User also enters a URL. When you click on the thumbnail, it takes you to the URL.Once you choose which field type you want, you will be able to enter the settings for the field.
389
Title What you want to call it. It also appears above the custom field when a user is creating/editing their GAR
Description A short description for the field. It too appears above the custom field when creating/editing an item.
Display Order The, er - order it displays. A lower number makes it display earlier :)Other settings should be self explanatory. However I'm sure Ill be writing info on each type later.
Step 2
Assign the custom field to one or more types.
392
Edit the types you want to assign the custom field to (admincp->gars->types).
At the bottom of the page, you will see all available types that you can assign. Assign by ticking the box next to the custom field and clicking Save.
388
From that stage, the fields will be available when editing and creating a new GARS controlled thread.
Step 3
Displaying the values of your custom fields
Make sure you have the custom_fields.php module registered.
go to admincp->gars->modules
Check the bottom section (Registered modules) to see if you have Custom Fields there.
If not, then add it by clicking Register New Module and adding the following settings:
title: Custom Fields
file: custom_fields.php
templates: GARS_custom_container, GARS_custom_row,GARS_custom_date,GARS_custom_input ,GARS_custom_text,GARS_custom_textarea,GARS_custom _thumbnail
Then click Save.
This will make the custom fields module available to your module sets.
Step 4
Add Custom Fields to your module sets
390
Edit a module set making sure you are on the showthread page.
Scroll to the bottom of the page and in the left selection box, choose Custom Fields, then the position you want to place it.
Click Save and the Custom Fields module will be in position.
Edit the Custom Fields module settings page by clicking it's name (or by selecting edit from the drop down menu next to its name).
391
Here you can edit the title for the module box when it displays. You can also select which Custom Fields display along with an optional caption.
You can also overwrite the templates GARS uses to display the custom fields. Leave the template settings blank for the default.
[B]Viola!
394
Whoop there it is...