Search

Ok, I’m almost a complete newbie at symphony and xslt, so I’m sure I’m probably just approaching this from the wrong perspective. Here’s the situation:

In a ‘people’ section which has a subsection manager field of ‘positions’, so that people can hold more than one position, and positions can be added inline when adding people.

Each ‘position’ has a title, and an optional organization with an optional link for the organization. So a position could be just a title, or a title and an organization.

I was trying to format it like: Position, Organization OR Position depending on whether there was an organization or not.

I’m guessing that in the actual controller logic for the frontend I can use xsl tags to format this the way I want it (something like {$position}, {$organization}). Is that the right idea?

Secondly, how do I do this in the backend caption for the subsection manager field, so that the caption reads with or without the comma?

I lucked across a workaround, using <br /> instead of a comma ({$position}<br />{$organization}), the <br /> tag seems to be ignored if there is no organization, but that feels like a hack, and I don’t understand why it works that way.

I’m really just trying to learn this system. Maybe this is the place for a component? Or is it a limitation of the backend system? I realize this is a minor issue, but for whatever reason, my brain works best by finding small things I don’t understand and trying to understand them so that the next time I encounter them (usually when they are a bigger issue), I know how to solve it.

Thanks!

On the front-end you can use an if or choose statement to generate your desired output. The Subsection Manager caption itself does only accept HTML and the given variables, so there is no XSL logic implemented to filter based on a value.

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