1 users online. Create an account or sign in to join them.Users

Search

Similar to the formatted and unformatted options for textareas, I’m trying to build a direct selection system for subsection fields in the data source editor using my Subsection Manager. In other words I’m trying to add a list of all subsection fields to the data source’s included elements list like this:

  • photos: name
  • photos: file
  • photos: description: unformatted
  • photos: description: formatted

(photos represents a Subsection Manager field)

While adding this list to the data source manager via fetchIncludableElements() is quite easy it seems not to be possible to fetch the user’s selection when building the XML on data source execution.

Does anybody know if it’s possible to acces the $dsParamINCLUDEDELEMENTS variable inside the appendFormattedElement() function which has been called by the current data source? Or at least the name of the current data source which would make it possible to access the data source file containing this variable directly.

This seems to be tricky. Does anybody know if the name of a data source is available anywhere in the field context?

I don’t think so, I think Symphony makes it a point to treat each Field as a blackbox.

I believe not. They are de-coupled so that a field doesn’t know about the Data Source that is calling it. The only way of really communicating between the two is to use delegates. There is only a single delegate that fires during DS execution and that is DataSourceEntriesBuilt.

I’m guessing the reason is that appendFormattedElement might not always be called by a Data Source, so leaving the implementation more open.

For the appendFormattedElement method to know about the DS you’d need to pass a reference to the DS object through the call to appendFormattedElement in datasource.section.php. I think. But I don’t think it’d be good practice to do so.

Brendan can say in 15 words what I need 100 to ;-)

Haha, as soon as I posted that though I found this on php.net.

Perhaps this could be of use in a roundabout sort of way?

Hm, get_called_class() looks good but it requires at least PHP 5.3 but Symphony is supposed to work with PHP 5.2.

Maybe I have to rephrase: Does anybody know a simple solution to offer a subselection of included fields for a field like Subsection Manager or Mediathek directly in the datasource manager?

I don’t.

Could you add another “Included elements” to the field’s configuration for when you add it to a section? This could then give you the option in a Data Source to choose:

  • photos: items only
  • photos: included elements only
  • photos: all elements

This is Bi-Link-esque: the items only replicates the <item>...</item> of a Select Box Link, included elements only would be the fields you’ve selected in the configuration of the field, and all elements would be all elements from the section.

Adding fine-grained control would be a nice to have, but I think it’s by no means a necessity. We do have Output Parameters for chaining after all.

You might even find that the field: mode structure is limited to a single colon. I don’t quite know how the string parsing is done, but from what I gather it was never intended to support field: sub-field: mode.

I don’t quite know how the string parsing is done, but from what I gather it was never intended to support field: sub-field: mode.

I know …

Is there a chance that Symphony 2.1 will offer more fine-grained options for extension developers in this area?

Lemme talk to A&A and I’ll get back to you.

Lemme talk to A&A

lol

Actually I’m going to start calling them “the A’s”

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details