1

I would like to render a partial with dynamic keys for the arguments.

In the partial:

<f:link.action action="{action}" controller="{controller}" 
arguments="{'{argument1name}': argument1, '{argument2name}': argument2}">
{bla}
</f:link.action>

So can argument1name and argument2name be written dynamicly in Fluid? What is the syntax, above is obviously wrong. Even better would be an array with an unknown number of arguments.

2
  • I must admit, I can not imagine a good reason for your usage of variable array key names. maybe you can evaluate the purpose and maybe another solution can be found. Commented Mar 13, 2019 at 6:55
  • 1
    I am using it in a Bootstrap modal (popup window) and want to make the partial only once, for different actions, arguments etc. Commented Mar 13, 2019 at 8:34

2 Answers 2

1

I came up with a solution for my problem. In the Fluid Template..

<f:variable name="modalArguments" value="{organization: organization, contactperson: contactperson}"/>
<f:render partial="Components/ActionModal" arguments="{modalTitle: 'Bla', modalBody: 'Are you sure {contactperson.name} bla?', action: 'delete', controller: 'Contactperson', modalArguments: modalArguments}"/>

In the partial something like

<f:link.action action="{action}" controller="{controller}" arguments="{modalArguments}" class="btn btn-primary">bla</f:link.action>

So it's possible to throw the arguments array in a variable.

Sign up to request clarification or add additional context in comments.

2 Comments

If this solved your problem, please mark the question as answered. This will help other people who are looking for answers or are trying to help people with unanswered questions.
Thats not a solution for the question. Thats a workaround for the specific situation.
0

As in fluid the key for arrays never is wrapped in ' your syntax obviously is wrong.
If a value is wrapped in ' it is constant text, otherwise it is interpreted as variable. So keys are handled in another ways than values.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.