Customize header address in v5 invoice

I am trying to customize a simple thing in the header on my invoice: I want Address 2 to live on the same line as Address 1. When I look in the code I see that each company address item is embedded in its own <p> tag:

<div id="company-address"><p data-state="encoded-html" data-ref="company_address-company.address1"><p>My street address</p></p><p data-state="encoded-html" data-ref="company_address-company.address2"><p>apt#</p></p><p data-state="encoded-html" data-ref="company_address-company.city_state_postal"><p>City, State, Zip</p></p><p data-state="encoded-html" data-ref="company_address-company.country"><p>Country</p></p></div>

I can find no place in the template customizer that allows me to output company_address-company.address1 and company_address-company.address2 in a single <p> tag together. And I can’t find any mention of it in the docs. Can someone point me in the right direction? Thanks

Hi,

I believe you’d need to replace the field stack with the individual field variables.

@ben is there another option?

And where is that located? When I look at the header code in the interface, I only see the wrapping elements:

<div id="header">
    <div class="logo-container">
        <img class="company-logo" src="$company.logo" alt="$company.name logo">
    </div>
    <div id="company-details"></div>
    <div id="company-address"></div>
</div>

Do you mean I should just replace the company-address div with my own, made up of the child elements?

well, that didn’t work:

<div id="company-address-div"><div data-state="encoded-html" data-ref="company_address-company.address1"></div><div data-state="encoded-html" data-ref="company_address-company.address2"></div></div>

You’d want to replace the company-address div with the individual variables you want shown.

https://invoiceninja.github.io/docs/custom-fields/#custom-fields

I just tried that, see above. And it didn’t work, at least in preview. Is there something else I need to do?

It doesn’t look like you’re using the variables, ie. $client.address1

1 Like

That works, thanks!!