Permalink
Browse files

Updated Docs. Tidied code

  • Loading branch information...
1 parent 7b2f96c commit 0bfdc9204a27f5b5e55a885b8ded9e12f70e0646 Christopher Imrie committed Dec 8, 2011
Showing with 20 additions and 48 deletions.
  1. +19 −35 README.textile
  2. +1 −13 system/expressionengine/third_party/morematrixrelations/ft.morematrixrelations.php
View
@@ -33,63 +33,39 @@ h2. Example Usage
h3. Simple Example
-If you have setup a Matrix field called 'people' and within the Matrix settings you have created a moreMatrixRelations field called 'name', your templates may look like this:
+If you have setup a Matrix field called 'people' and within the Matrix settings you have created a moreMatrixRelations field called 'name', your templates may look like this. The fieldtype:
<pre>
{exp:channel:entries channel="channel_name"}
- <ul>
{people}
- <li>{name}</li>
+ <ul>
+ {name}
+ <li>{title}</li>
+ {/name}
+ </ul>
{/people}
- </ul>
{/exp:channel:entries}
</pre>
-By default the field returns the entry title:
+The output could be something like the following:
<pre>
<ul>
<li>John Smith</li>
<li>Richard Jones</li>
<li>Sarah Richards</li>
</ul>
-</pre>
-
-h3. Parameter Example
-
-You can access different information regarding the related entry by using the 'field' parameter:
-
-<pre>
- {exp:channel:entries channel="channel_name"}
- <ul>
- {people}
- <li>{name field="url_title"}</li>
- {/people}
- </ul>
- {/exp:channel:entries}
-</pre>
-
-Produces:
-
-<pre>
<ul>
- <li>john-smith</li>
- <li>richard-jones</li>
- <li>sarah-richards</li>
+ <li>James Parker</li>
+ <li>Sarah Richards</li>
</ul>
</pre>
-h2. Parameters
-
-h3. _field_
-Example:
-<pre>
- {field_name field="entry_id"}
-</pre>
+h2. Variables
-Allows you to display different information about the related entry. Accepts the following field names:
+The field type must always be used as a tag pair. The following top level channel entry variables are available inside the moreMatrixRelations tag pair:
* entry_id
* title - _[default]_
@@ -100,9 +76,17 @@ Allows you to display different information about the related entry. Accepts th
* status
* page_uri
+Channel custom fields are not available.
+
h2. Change log
+h4. 1.4
+
+* Ability to select multiple entries from within the matrix field.
+* Configuration option to restrict selection to a single entry or allow the multi select.
+* Template tag updated to use tag pairs only.
+
h4. 1.3
* Ability to select entries from multiple channels. Entries are listed organised by channel when using the fieldtype in a Matrix field.
@@ -4,7 +4,7 @@ class Morematrixrelations_ft extends EE_Fieldtype {
var $info = array(
'name' => 'moreMatrixRelations',
- 'version' => '1.3'
+ 'version' => '1.4'
);
@@ -156,32 +156,20 @@ function replace_tag($data, $params = array(), $tagdata = FALSE)
$vars = $q->result_array();
-
foreach($vars as $row){
-
//Add the pages URI
$row['page_uri'] = "";
foreach($data as $entry_id){
if(isset($this->EE->config->config['site_pages'][$this->EE->config->item('site_id')]['uris'][$entry_id])){
$row['page_uri'] = $this->EE->config->config['site_pages'][$this->EE->config->item('site_id')]['uris'][$entry_id];
}
}
-
-
-
- //if(isset($params['field'])){
- // return isset($qa->$params['field']) ? $qa->$params['field'] : NULL;
- //}else{
- // return $qa->title;
- //}
-
}
return $this->EE->TMPL->parse_variables($tagdata, $vars);
-
}

0 comments on commit 0bfdc92

Please sign in to comment.