Search

hi,

i am in the process of writing an extension and want to create a set of nested parameters in the param pool. i am calling the following function when delegate FrontendParamsResolvefires:

public function __addParam($context) {
    $context['params']['parent']['child1'] = 'child one text';
    $context['params']['parent']['child2'] = 'child two text';
}

what i expected to get was either:

Option 1:

<parent>
    <child1>child one text</child1>
    <child2>child two text</child2>
</parent>

Option 2:

<parent>
    <item handle="child1">child one text</item>
    <item handle="child2">child two text</item>
</parent>

But in fact you get

<parent>
    <item handle="child-one-text">child one text</item>
    <item handle="child-two-text">child two text</item>
</parent>

which is not very usable, because the handle is variable and you cannot use it in the templating layer.

i don't know if this is a bug or expected behavior, but i think it would be really good to have Option 2 in this case, generic items with a specific handle.

cheers
daniel

should i post this as a bug on github? or is this the correct behavior? i don't think it is, but maybe my thinking is wrong.

cheers
daniel

There is also a frontendParamsPostResolve that is used for datasource parameters and those have the levels you like to approach. But don't know if that works, but maybe you can give it a try.

I think that this is the intended behaviour. Params may have items, but there is no "nesting" of params in Symphony. (How should filtering on params ever work then?) If you need nested data, you should output datasource XML, not params.

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