Category Select 1.1.2

SC Category Select is a Pixel&Tonic's FieldFrame FieldType which displays selected category options in a drop-down list. It only allows selection of a single category. You can select multiple category groups. The FieldType respects sub-categories.

The category id is saved - not the category name - however you can display the heading, description and url_title using some custom functions. See "Usage" below for details.

On saving an entry, the 'real' category will be automatically selected as well, for ALL SC Category Select fields listed on the publish form... even those in a FF Matrix. This allows template interaction with the fieldtype tag, and the use of normal category tags. It also has the added benefit of allowing you to use the category search in the CP Edit tab.

It is recommended that you 'hide' the categories tab when using this FieldType, as the add-on overwrites category selections for the entry on save.

Download

Download Category Select from Github

Version

1.1.3

1.1.2

1.1

1.0

Requirements

SC Category Select requires ExpressionEngine 1.6.8+. This FieldType does not work in EE2.0.

SC Cateogry Select requires Pixel&Tonic's FieldFrame 1.4 extension.

Installation

The SC Category Select FieldType contains an extension and language file:

  1. Download the latest version of SC Category Select
  2. Extract the .zip file to your desktop
  3. Copy system/extensions/fieldtypes/sc_category_select to /system/extensions/fieldtypes
  4. Copy the language/english/lang.sc_category_select.php file to /system/languages/english
  5. Open the FieldTypes Manager
  6. Enable the SC Category Select FieldType
  7. The FieldType will now be available when creating a Custom Weblog Fields

Usage

Creating your fieldtype

Using this FieldType is easy.

Create a new Weblog Custom Field as usual. Select SC Category Select from the Field Type dropdown.

Select one or more Category Groups from the multi-select list.

You can also use this field type with FieldFrame Matrix.

Finish entering all other details for the Custom Field and save it!

Using the fieldtype in your template

To display the category id, use the custom field tag as normal for the SC Cateogry Select field:

<p>The selected category id is {my_custom_sc_category_select_field}.</p>

You can also display the category heading, description and url_title using (will return blank if nothing exists):

<p>Category heading - {my_custom_sc_category_select_field:heading}.</p>

<p>Category description - {my_custom_sc_category_select_field:description}.</p>

<p>Category url_title - {my_custom_sc_category_select_field:url_title}.</p>

Please note!

To use the normal {exp:weblog:categories} tags, you must have added the appropriate category groups to the weblog you are using.

License

Ownership of this software always remains property of the author.

You may:

You may not:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.