Closed nilshoerrmann closed 10 years ago
Yes, integration + this extension.
You'll have to add and adjust the additional setting to a DS with an associative field in the output. I've used a select box with dynamic values for testing.
I just pushed a few changes to the repo: associations can now be included in the DS editor directly.
The issue mentioned above still exists. If I print the Data Source before execution, I get the following output (showing the included elements correctly:
datasourceassociations Object
(
[dsParamROOTELEMENT] => associations
[dsParamPAGINATERESULTS] => no
[dsParamSTARTPAGE] => 1
[dsParamREDIRECTONEMPTY] => no
[dsParamSORT] => system:id
[dsParamASSOCIATEDENTRYCOUNTS] => no
[dsParamINCLUDEDELEMENTS] => Array
(
[0] => festivaljahr
[1] => anfang
[2] => ende
)
[dsParamSOURCE] => 2
[_env:protected] => Array
(
)
[_param_output_only:protected] =>
[_dependencies:protected] => Array
(
)
[_force_empty_result:protected] =>
[_negate_result:protected] =>
[dsParamFILTERS] => Array
(
[system:id] => 660, 624
)
)
But the resulting XML tree looks like this:
XMLElement Object
(
[_name:XMLElement:private] => associations
[_value:XMLElement:private] => Array
(
)
[_attributes:XMLElement:private] => Array
(
)
[_children:XMLElement:private] => Array
(
[0] => XMLElement Object
(
[_name:XMLElement:private] => section
[_value:XMLElement:private] => Aktuelles
[_attributes:XMLElement:private] => Array
(
[id] => 2
[handle] => aktuelles
)
[_children:XMLElement:private] => Array
(
[0] => Aktuelles
)
[_processingInstructions:XMLElement:private] => Array
(
)
[_dtd:XMLElement:private] =>
[_encoding:XMLElement:private] => utf-8
[_version:XMLElement:private] => 1.0
[_elementStyle:XMLElement:private] => xml
[_includeHeader:XMLElement:private] =>
[_selfclosing:XMLElement:private] => 1
[_allowEmptyAttributes:XMLElement:private] => 1
)
[1] => XMLElement Object
(
[_name:XMLElement:private] => entry
[_value:XMLElement:private] => Array
(
)
[_attributes:XMLElement:private] => Array
(
[id] => 624
)
[_children:XMLElement:private] => Array
(
)
[_processingInstructions:XMLElement:private] => Array
(
)
[_dtd:XMLElement:private] =>
[_encoding:XMLElement:private] => utf-8
[_version:XMLElement:private] => 1.0
[_elementStyle:XMLElement:private] => xml
[_includeHeader:XMLElement:private] =>
[_selfclosing:XMLElement:private] => 1
[_allowEmptyAttributes:XMLElement:private] => 1
)
[2] => XMLElement Object
(
[_name:XMLElement:private] => entry
[_value:XMLElement:private] => Array
(
)
[_attributes:XMLElement:private] => Array
(
[id] => 660
)
[_children:XMLElement:private] => Array
(
)
[_processingInstructions:XMLElement:private] => Array
(
)
[_dtd:XMLElement:private] =>
[_encoding:XMLElement:private] => utf-8
[_version:XMLElement:private] => 1.0
[_elementStyle:XMLElement:private] => xml
[_includeHeader:XMLElement:private] =>
[_selfclosing:XMLElement:private] => 1
[_allowEmptyAttributes:XMLElement:private] => 1
)
)
[_processingInstructions:XMLElement:private] => Array
(
)
[_dtd:XMLElement:private] =>
[_encoding:XMLElement:private] => utf-8
[_version:XMLElement:private] => 1.0
[_elementStyle:XMLElement:private] => xml
[_includeHeader:XMLElement:private] =>
[_selfclosing:XMLElement:private] => 1
[_allowEmptyAttributes:XMLElement:private] => 1
)
It's outputting the correct entries, only the fields are missing. Ideas?
Doh! I seem to have stored the wrong field ids …
This is question for @brendo:
For the inline output of associated entries I'll add a few settings the Data Source file:
This information is used to dynamically create a custom Data Source to fetch the needed entries, see https://github.com/hananils/association_output/blob/master/extension.driver.php#L67-L75:
The problem is that
$datasource->dsParamINCLUDEDELEMENTS = $settings['elements'];
doesn't have any effect. If I print$datasource
before execution, I'll see that all settings are in place correctly, still the Data Source doesn't return any elements. If I set the same elements in the dummy Data Source filedata.associations.php
directly, it works though.Any idea what's going on here, what I'm doing wrong here?