Search

Hi, I'm looking for some advice on adding a biography section for system authors.

I have a "Profiles" section which includes the (system) author field The "Article" section includes the (system) author field - I want to use the "Select current user by default"

I can't figure out how to create a data source that takes the author ID output from the article and grabs (filters) the correct profile? At least not without outputting all profile records.

Or maybe this is the wrong way to go about it?

No, your approach is correct. The concept you're looking for is called "datasource chaining".

You have to select the Author Field as your "parameter output" and then use it to filter the System ID Field of your Profiles section.

Thanks phoque, I was thinking it was chaining but in the Parameter Output drop-down there is no choice for Author, only "System Author" so it always outputs '1' no matter who the author is.

The Article section has 9 fields: title, date etc. and a (system) author field.

Ah you're right. Actually, this has also already been discussed on the issue tracker, however the code there isn't optimal.

The following patch should enable the feature you're looking for:

From 4d17999d51ec5ed834ba5b65e7a57d866867d273 Mon Sep 17 00:00:00 2001
From: Nils Werner <nils.werner@gmail.com>
Date: Wed, 18 Jan 2012 15:35:52 +0100
Subject: [PATCH] Allow ParamOutput for Author fields

---
 symphony/lib/toolkit/fields/field.author.php |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/symphony/lib/toolkit/fields/field.author.php b/symphony/lib/toolkit/fields/field.author.php
index fb8c06b..0cccb72 100755
--- a/symphony/lib/toolkit/fields/field.author.php
+++ b/symphony/lib/toolkit/fields/field.author.php
@@ -61,6 +61,11 @@
            return $this->canToggle();
        }

+       public function allowDatasourceParamOutput() {
+           return true;
+       }
+
+
    /*-------------------------------------------------------------------------
        Setup:
    -------------------------------------------------------------------------*/
@@ -235,6 +240,10 @@
            return parent::prepareTableValue(array('value' => General::sanitize(implode(', ', $value))), $link, $entry_id);
        }

+       public function getParameterPoolValue($data, $entry_id = null) {
+           return $data['author_id'];
+       }
+
    /*-------------------------------------------------------------------------
        Filtering:
    -------------------------------------------------------------------------*/
-- 
1.7.4.1

After reading this thread I added some lines to field.author.php

public function allowDatasourceParamOutput(){
    return true;
}

public function getParameterPoolValue(array $data, $entry_id=NULL){
    return $data['author_id'];
}

Oops, should have refreshed before posting

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details