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

Replace multi-line paragraphs in templates #360

Open
rstoeber opened this issue Sep 6, 2014 · 2 comments
Open

Replace multi-line paragraphs in templates #360

rstoeber opened this issue Sep 6, 2014 · 2 comments

Comments

@rstoeber
Copy link

rstoeber commented Sep 6, 2014

The template feature for modifying docx files is really cool and appears to work perfectly with all of my test documents. However, as the PHPWord documentation says "Only single-line values can be replaced." which means that I can't insert custom paragraphs. Any chance that will be available soon?


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

@FBnil
Copy link

FBnil commented Oct 4, 2017

@rstoeber It depends on what you actually want. If you want multiple lines in a text, then they are actually separate paragraphs and using cloneBlock() you can grab such paragraphs and make them multiple, then replace the text in each.

${myblock}
${myline}
${/myblock}

If the enters must be inside, say, a listitem (bullet point) without going into a new bullet point, then you actually want a shift-enter, and that is done by inserting a </w:t><w:br/><w:t> at the point where your \n should be. I have a branch that does that, but it has not been merged yet.

For a solution see also #268

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to help by debugging it further and sharing your results.
Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
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

3 participants