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

Method to handle images not able to be wrapped in merge fields #91

Open
stadelmanma opened this issue Feb 8, 2018 · 0 comments
Open
Labels

Comments

@stadelmanma
Copy link
Collaborator

The current block structure used by sablon to add images to the template suffers from a requirement that the merge fields be need to be inline with the image. This method works well if end user needs to use a "loop" or "if" construct in the template with images. Oddly positioned images wouldn't make sense here because they would visually exist outside of the expression block in the first place.

A relatively simple fix that might work for positioned images is to add the proper "merge field" text to the title attribute of the placeholder image. A second parser would run after the initial work of the MailMerge parser is completed to collect all of the tags formatted like: <wp:docPr id="4" name="Picture 4" title="@test.data.plot2"/>. The rId of the <a:blip r:embed="rId5"/> tag would get updated as needed to the real image value. The title attribute can be easily set and updated in MS Word via the "Alt Text" tab on the formats pane.

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

No branches or pull requests

1 participant