Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding lists to template #879

Open
chriship opened this issue Aug 31, 2016 · 8 comments
Open

Adding lists to template #879

chriship opened this issue Aug 31, 2016 · 8 comments

Comments

@chriship
Copy link

chriship commented Aug 31, 2016

I cannot find any tutorial on this. I'd like to add an array to a template as a list. cloneRow seems to only work for tables. So doing something like this does not work:

$templateProcessor->cloneRow('listOptions', count($listOptions));
for($i = 0; $i < count($listOptions); $i++){
    $templateProcessor->setValue('listOptions#'.($i+1), htmlspecialchars($listOptions[$i], ENT_COMPAT, 'UTF-8'));
}

Any ideas?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@reda7171
Copy link

Up

@nesben
Copy link

nesben commented Jun 10, 2021

Has anyone found a solution?

@fd6130
Copy link

fd6130 commented Oct 5, 2021

2021 still no solution for this : (

@nesben
Copy link

nesben commented Oct 5, 2021

@fd6130 I have actually found a workaround for this issue.

I created a list inside of a TextBox container, which apparently supports lists.

Though, you need to specify a height for your TextBox container.

Hope this helps :)

@fd6130
Copy link

fd6130 commented Oct 5, 2021

@fd6130 I have actually found a workaround for this issue.

I created a list inside of a TextBox container, which apparently supports lists.

Though, you need to specify a height for your TextBox container.

Hope this helps :)

Can you share the code here?

@nesben
Copy link

nesben commented Oct 7, 2022

Hey @fd6130

Apologies for the late reply...

Do you still need a code example? I recently re-wrote the logic, but it still works fine.

It's a very hacky solution where i match certain strings and generate lists out of it from pre-defined texts i have in a JSON file.

@Ulrich-Stern
Copy link

Hey @fd6130

Apologies for the late reply...

Do you still need a code example? I recently re-wrote the logic, but it still works fine.

It's a very hacky solution where i match certain strings and generate lists out of it from pre-defined texts i have in a JSON file.

I still look for the answer. Can you share the code. Thank you

@igorbalkinvwdw
Copy link

hey guys, I've found a solution that worked for me, I've described it here https://stackoverflow.com/a/76530712/6427085

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants