Search

I’m having a bit of trouble wrapping my head around relational content in Symphony; I can’t figure out how to link them together.

For example, here’s something similar to what I’m trying to do:

I have a section, articles, that has a field to select the author, which is linked to an entirely different section, called authors. The authors section stores things like email, full name, etc.

How would I go about getting the author information for each post on, say, a home page? I don’t want all of the authors’ profiles passed to the front page, only the ones of authors that actually appear there.

This is rather confusing; let me know if there’s something I can clarify.

No problem:

In your Homepage Articles datasource (i’ll call it ‘homepage-articles’), select ‘author’ under Parameter Output>User Field…

This will add a parameter called ‘ds-homepage-articles’ into the param pool, which you can use to filter other data sources. IT will contain the System IDs of all authors connected to any of the article entries output by your ‘homepage-articles’ datasource.

Then, create an Authors datasource (if you haven’t already). Add a filter for this datasource, filtering by System ID, with a value of ‘{$ds-homepage-articles}’.

This should result in the Authors datasource outputting them correct authors for the articles. It’s then up to your XSLT to output them accordingly.

You could also reuse the Authors datasource by using a colon in the filter. So if your single article page DS is called ‘single-article’, and it outputs the author ID into ds-single-article, you could change the filter on the AUthors DS to :

{$ds-homepage-articles:$ds-single-article}

This means, if there is no homepage articles datasource outputting an author id, check to see if there is a single article datasource doing it instead.

Wow; I’ll give this a try, thanks!

Seriously, you have no idea how helpful this is :)

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