Move address up when barcode empty

Hi,

Is there a way to move the AddressText up when the AddressBarcode is empty (Field dpidBarcode is empty)?

I had this implemented in PP7 and am working out how to convert out designs, below is most of the source of the snippet.

<div class="AddressBarcode" anchor="page_media_0"
style="position: absolute; overflow: hidden; -moz-box-sizing: border-box; width: 100mm; height: 10mm; top: 207.874px; left: 120.945px;" offset-x="120.944885" offset-y="207.87402">
    <div id="dpidBarcode" anchor="page_media_0"
    type="com.objectiflune.connect.addin.barcodes.australiapost" offset-x="120" offset-y="124">
    </div>
</div>
<div class="AddressText" anchor="page_media_0"
style="position: absolute; overflow: hidden; -moz-box-sizing: border-box; width: 130mm; height: 60mm; top: 226.767px; left: 120.95px;" offset-x="120.94999694824219" offset-y="226.76666259765625">
    <table id="table_1" class="table-grid" data-column-resize="" cellpadding="0" cellspacing="0" style="width: 60mm; border-width: 0pt;">
<TABLE ROWS HERE>
    </table>
    <p style="margin-bottom: 0px; white-space: pre;">@AddressBlock@</p>
</div>

Gareth,

The issue here is that both your address text and barcode are aboslutely positioned - essentially, placed at a specific location on the page, not a “variable” one.

Placing these elements in-line (just adding a paragraph or table directly on the page) instead of using the Positioned Box, should take care of this issue.

~Evie

Thanks Evie,

I have now removed the second position box so all of the elements are now inside a single positioned box, but the table and subsequent address lines still do not move up when there is no barcode?

Edit: Also, it seems as though the barcode is being drawn when empty and the image shown, is that why the text does not move up?

<div class="AddressBarcodeBox" anchor="page_media_0"
style="position: absolute; overflow: hidden; -moz-box-sizing: border-box; width: 140mm; height: 80mm; top: 55mm; left: 32mm;" offset-x="120.944885" offset-y="207.87402">
    <div id="dpidBarcode" anchor="page_media_0"
    data-params="{&quot;height&quot;:10,&quot;width&quot;:2,&quot;spacing&quot;:3,&quot;extendedHeight&quot;:20,&quot;scale&quot;:0,&quot;outputFormat&quot;:&quot;SVG&quot;,&quot;barColor&quot;:&quot;#000000&quot;,&quot;backColor&quot;:&quot;#FFFFFF&quot;}"
    style="width: 315px; height: 5mm; position: relative; left: -0.383333px; top: 0px;"
    type="com.objectiflune.connect.addin.barcodes.australiapost" offset-x="120" offset-y="124">
    </div>
    <table id="table_1" class="table-grid" data-column-resize="" cellpadding="0" cellspacing="0" style="width: 60mm; border-width: 0pt;">
        <tbody>
            <tr>
                <td style="width: 23.35%; font-size: 5pt; border-bottom-width: 0px; border-right-width: 0px; border-style: none; text-align: left; padding: 0px;">
                    @EnvelopeID@<br>
                </td>
                <td style="width: 39.21%; font-size: 5pt; border-style: none; border-bottom-width: 0px; border-right-width: 0px; text-align: center; padding: 0px;">
                    @ClientReference@<br>
                </td>
                <td style="width: 17.62%; font-size: 5pt; border-style: none; border-bottom-width: 0px; border-right-width: 0px; height: 4.101mm; text-align: right; padding: 0px;">
                    @PostBSP@<br>
                </td>
                <td style="width: 19.82%; font-size: 5pt; border-style: none; border-bottom-width: 0px; border-right-width: 0px; height: 4.101mm;">
                    <br>
                </td>
            </tr>
        </tbody>
    </table>
    <p style="margin-bottom: 0px; white-space: pre;">@AddressBlock@</p>
</div>

Gareth, basically the issue you’re having is that you’re still using positioned boxes. Positioned boxes are placed “on top of” the page, are “free flowing” and “do not move relative to other things”. Essentially, They’re a box you place on the page that has no influence from other elements and do not influence other elements. So… don’t use them. This is probably one of the biggest shift that you will have to do when working with Connect: it’s a flow, not a canvas.

So how do you make this work? Well, why not just put everything inside a table and use the cells to position your elements? Or just use regular paragraphs, one after the other, and if you need to move them to the right, just use margins in the Formatting dialog? A left margin of 32mm will place your barcode (at least horizontally) at the same place as a positioned box with a “left” position of 32mm. And then you can adjust everything much more easily.

~Evie

Thanks Evie,

That does not work for me, I need the address bar to start at 55mm from the top and 32 from the left for positioning in a window envelope.

I have solved this now with the one positioned box and using a script to hide the #dpidBarcode element. I have also created a conditional script to test with but can not link the conditional script to the barcode element in the designer.