This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

mittul
mittul

I am using OctoberCMS DynamicPDF Plugin and its working as per my expectations.

However, I have a PDF brochure in which I want to generate my header text dynamically based on each page I generate. Here is my sample of PDF Brochure.

enter image description here

enter image description here

As you can clearly see my dynamic header text CAPABILITIES and OUR TEAM and I want to somehow pass in my Layout dynamically.

I am trying to pass using below code from my template file to my layout file something like this.

Template File

{% set dynami = 'CAPABILITIES' %}
{% put dynamicHeader %}
{{ dynami }}
{% endput %}

<!-- ========================== -->
<!-- CAPAPBILITES SECTION START -->
<!-- ========================== -->
<body style="background-color: #fff;">
   <div id="content">
   Capabilities content
   </div>
</body>
<!-- ========================== -->
<!-- CAPAPBILITES SECTION END -->
<!-- ========================== -->

<!-- ========================== -->
<!-- OUR TEAM SECTION START -->
<!-- ========================== -->
{% set dynami = 'OUR TEAM' %}
{% put dynamicHeader %}
{{ dynami }}
{% endput %}
<body style="background-color: #fff;">
   <div id="content">
    Our Team Content 
   </div>
</body>
<!-- ========================== -->
<!-- OUR TEAM SECTION END -->
<!-- ========================== -->

Layout File

<html>
    <head>
        <style type="text/css" media="screen">
            {{ css|raw }}
        </style>
        <title>Regency Brochure</title>
    </head>

   <div id="header">   
      <div style="text-align: right; font-size: 20px; color: #b49132; text-transform: uppercase; font-family: 'Montserrat-Bold'; position: absolute; right: 3.5%; top: 25px;">
        {% placeholder dynamicHeader %}
        </div> 
    </div> 
    <div id="footer">    
    </div>      
        {{ content_html|raw }}    
</html>

As you can see, I am using {% placeholder dynamicHeader %} to get my dynamic header which I am sending dynamically from my Template File using below code.

{% set dynami = 'CAPABILITIES' %}
{% put dynamicHeader %}
{{ dynami }}
{% endput %}

But the thing is, its always overriding the last value which I am sending. In this case, its using OUR TEAM for all the pages.

I have read through Plugin's Documentation Tab. And they are saying...

Plugin supports using CMS partials and filters inside template and layout markup.

But I am getting no idea so far how to utilize CMS Partials here inside my layout as per my scenario because I cant check my page number and put number static because my content is dynamic so I cant put page number condition anywhere.

Only thing I can do is to somehow pass it.

Can someone guide me to implement this please.

virgo9793756674
virgo9793756674

Hello friend, a question. How did you put the logo? I have read the documentation but I already did everything according to the documentation but the image still does not come out. thanks

zs60815
zs60815

virgo9793756674 said:

Hello friend, a question. How did you put the logo? I have read the documentation but I already did everything according to the documentation but the image still does not come out. thanks

Do you get the image placeholder where the logo should be?

mjauvin
mjauvin

@mittul you can't use multiple body tags... use section tag instead.

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.