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

Add newline or <br />? if not empty #17

Closed
theopensourcerer opened this issue Apr 3, 2020 · 6 comments
Closed

Add newline or <br />? if not empty #17

theopensourcerer opened this issue Apr 3, 2020 · 6 comments

Comments

@theopensourcerer
Copy link

Forgive if this is dumb question - I couldn't find anything obvious in the manual...

Suppose I have several fields which form an Address. I would like to add a newline to each field, only if they are not empty.

i.e.

[onload.street1;ope=add:\n][onload.street2;ope=add:\n][onload.city;ope=add:\n][etc...

Is something like this possible?

@roxblnfk
Copy link
Contributor

roxblnfk commented Apr 4, 2020

Have you watched this section? https://www.tinybutstrong.com/manual.php#html_conditional_section

@theopensourcerer
Copy link
Author

@roxblnfk Thanks - I have no idea how I missed that!!!

@Skrol29
Copy link
Owner

Skrol29 commented Apr 5, 2020

I would suggest
<br>[onload.street1;magnet=br;mtype=m*]
or
[onload.street1;magnet=_] for text new line

@theopensourcerer
Copy link
Author

@Skrol29 Thanks for responding.

I saw mention of the block=_ in the documentation but didn't realise I could apply it to fields.

Unfortunately I just tried either method without success.

Using [onload.street1;magnet=_] the template is created, but the resulting odt file couldn't be opened.
Screenshot from 2020-04-05 10-09-17

And with <br>[onload.street1;magnet=br;mtype=m*] the br is just being printed as-is in the resulting odt template and not intepreted...

Screenshot from 2020-04-05 10-06-46

@theopensourcerer
Copy link
Author

Awesome - I've worked it out. This works for OpenTBS odt files...

`[onload.bill_street;magnet=text:line-break;mtype=*m]followed by a soft line-break. See screenshot:
Screenshot from 2020-04-05 10-57-02

@Skrol29
Copy link
Owner

Skrol29 commented Apr 8, 2020

« magnet=_ » is for textual line break, like "/n"
No good for XML contents.

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

No branches or pull requests

3 participants