IM Extra Fields

Downloads: 1908
Category: Plugin
Compatible with: GetSimple 3.3 - 3.3

Last Updated: July 15, 2018
Tags: custom fields custom pages extra fields extended pages
Author: Bigin
Support: Support Forum

(5) 2 Votes

Plugin Description:

IM Extra Fields

GetSimple plugin based on ItemManager 2

IM Extra Fields is a GS plugin based on ItemManager 2.4.2 IM Extra Fields plugin allows to add new fields for GetSimple CMS pages and access them within your template very easily. This plugin is a kind of a mix between I18N Custom Fields and Special Pages plugins and is a very powerful tool.

For instance, it allows you to create a bunch of categories with different fields and properties. You can select them in the Pages menu under Optiones and the assigned ItemManager fields appear immediately in the content below GS default editor field.

example

Usage

It is recommended to add one or more (according to your needs) functions to your functions.php file in your theme/ directory. You can then call these in your template to retrieve items you need. For example, to get an item assigned to the current page, you can use this function:

/**
 * This function returns SimpleItem object assigned to the current page.
 * Function expects category id as parameter.
 *
 * @param int $category_id - Category id to which item belongs
 *
 * @return SimpleItem object | null
 */
function get_page_item($category_id) {
    $imanager = imanager();
    $mapper = $imanager->getItemMapper();
    $mapper->alloc($category_id);
    $pageId = Util::computeUnsignedCRC32(return_page_slug());
    return $mapper->getSimpleItem($pageId);
}

Now you can use this function in your template as follows:

$item = get_page_item(1);
if($item) {
    echo "<h3>$item->name</h3>";
    echo $item->your_field;
}

... where the argument 1 is the category id to which the item belongs.

If you have any further questions relating to IM Extra Fields you will find help in the ItemManager 2 Thread:

http://get-simple.info/forums/showthread.php?tid=7293

Changelog:

1.0.2
- Minimal style adjustments and GS 3.4-Alpha adaptations
- The usage of SimpleItem objects implemented

1.0.1 A new feature was added to speed up item access with very large quantities of data, see:

HIGH_DATA_CAPACITY in im_extra_fields.php file (Feature works only with ItemManager 2.3.6)

Install Instructions:

Requirements:

ItemManager 2.4.2 is required to get IM Extra Fields working

Installing IM Extra Fields from the ZIP file

Extract and upload the contents of the ZIP archive to your plugins folder. Login to GetSimple admin and enable IM Extra Fields on the Plugins tab.

Archived Versions:

These are old versions of this file. Please use with caution as they are probably out of date and no longer supported. ShowHide