hi all, I'm in packing slip template I want to bo...
# advancedpdf
d
hi all, I'm in packing slip template I want to bold the
addressee
in ${salesorder.billaddress} I need guidance on how to achieve this Thanks
s
are you saying you want only the addressee bold, and not the other address lines? there’s no specific way to target one line of the address, though you might be able to make a function that inserts a <b> tag at the start, then closes it when the first line break <br /> is encountered.
s
you can use <strong> tag also
d
just throwing it out there, wonder if you could use
{salesorder.billaddressee}
and some regex to insert the `<b>`/`<strong>` tags... could potentially instead use freemarker's string built-in
?split
on billaddress
something like:
Copy code
${salesorder.billaddress?replace(salesorder.billaddressee, '<b>${salesorder.billaddressee}</b>')}
or alternatively:
Copy code
${salesorder.billaddress?split(salesorder.billaddressee)?join('<b>${salesorder.billaddressee}</b>')}
edit: typo
verified that both of these are working. but you need to wrap them in a
<#if salesorder.billaddressee?has_content>
in case billaddressee is blank
the benefit of doing it this way is that it doesn't matter the order of the address components on the address form (i.e. if you have different address layouts for different countries)
d
thanks a lot @David B. Never thought of we can make use
salesorder.billaddressee
before, we will use your solution moving forward