3

How can I fix a footer section at the bottom of the page of a Message Template? (no matter whether how much text the user is adding - the footer with our contact and donation account should always be at the very bottom of the page).

We would like to use Message Templates and the CiviCRM action "Print/Merge Document" to let our team write a letter to a contact within CiviCRM (getting address etc. filled through tokens), export it as a PDF and print it for postal mailing. Our previous CRM software had to option to generate a Word document prefilled with the contact information and including a footer element for this.

I found an old forum question about this but unfortunately it doesn't offer any solutions.

1

All you need to do is create a table in the first place - Add header in the top row and calculate the number of rows can fit in the page and add the footer to the bottom of the table

Now when ever you add content to the page make sure you add to the table row by row and any empty row should be filled with  

By doing this you are always setting a set row and the footer remains in the same place

you need to create an extension for the same

I guess this helps !!!

If my suggestion is bit tricky - just wait for others to reply

Thanks

1

Use nested tables. The first table has a < tr> with a height to where you want your footer to start then nest a table within the < td> to hold your Smarty query. You can use valign="top" to put your data at the top of the row rather than centered. As long as your Smarty query results are not bigger than your row height, your footer will always be in the same place. Add table rows as needed to create your footer.

<table align="left" cellpadding="4" cellspacing="0" class="table" style="width: 875px;">
<tbody>
    <tr style="height:385px;">
        <td valign="top">
        <table align="left" cellpadding="4" cellspacing="0" class="table" style="width: 870px;border: 1px solid #281c1d;">
            <tbody>
                <tr style="padding: 8px; border: 1px solid #281c1d;">
                    <th style="padding: 8px;">Header1</th>
                    <th style="padding: 8px;">Header2</th>
                    <th style="padding: 8px;">Header3</th>
                    <th style="padding: 8px;">Header4</th>
                </tr>
                <!--
{Smarty} 

{foreach from=$result.values}  


-->
                <tr style="padding: 4px; border: 1px solid #281c1d;">
                    <td style="padding: 4px; border: 1px solid #281c1d;">{$value}</td>
                    <td style="padding: 4px; border: 1px solid #281c1d;">{$value2}</td>
                    <td style="padding: 4px; border: 1px solid #281c1d;">{$value3}</td>
                    <td style="text-align:right;padding: 4px; border: 1px solid #281c1d;">$ {$value4}</td>
                </tr>
                <!--
{/foreach}
-->                 
            </tbody>
        </table>
        </td>
    </tr>
    <tr>
        <td>Put Footer</td>
    </tr>
</tbody>
</table>

Add rows and columns to the footer as needed

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.