Skip to content
ExpressionEngine 2.0 drop down list custom field of all your ExpressionEngine sites being run by the Multiple Site Manager
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cki_sitelist
README.textile

README.textile

CKI Site List Custom Field

ft.cki_sitelist.php

This is an EE2.0 custom field type that will add a drop down list of all your ExpressionEngine sites being run by the Multiple Site Manager

Info

Developed by Christopher Imrie, http://www.christopherimrie.com
License: http://creativecommons.org/licenses/by-sa/3.0/

Requirements

  • ExpressionEngine 2.0

Installation

  • Copy the cki_sitelist folder to your system/expressionengine/third_party/ folder.
  • Go to Add-ons → Fieldtypes in the ExpressionEngine control panel and install the fieldtype labelled ‘CKI Site List’
  • Select CKI Site List as the field type when creating a new custom field type

How to use

The field type supports single tags only. Use the tag on its own to return the selected site short_name_

Simple Example

Lets say you have defined a custom field with a field label of Site list and field name site_list and through the publish form selected a site with an short_name of “default_site”. You can produce the site short name of the selected site by simply calling the field name tag on its own:

	
		{exp:channel:entries channel="blog"}
			<p>You selected site short name is {site_list}</p>
		{/exp:channel:entries}
	

Returns:


<p>You selected site short name is default_site</p>

Parameter Example

Using the same site you have selected in the above example, we can retrieve different site attributes by using the display parameter:

	
		{exp:channel:entries channel="blog"}
			<p>You selected site ID is {site_list display="id"}</p>
		{/exp:channel:entries}
	

Returns:


<p>You selected site ID is 1</p>

Parameters

Display

	display="label"

Allows you to specify what site attribute to return. This parameter is optional, and if not used, the tag will return the site short name by default.

Accepts the following variables:

  • id – Return the site id
  • label – Returns the site label
  • short_name – Returns the site short name
  • description – Returns the site description

Changelog

1.1

  • Updated to use the newly published fieldtype API

1.0

  • Initial Commit
You can’t perform that action at this time.