I've read the help on page templates and can see that we can hardcode a logo, other image, of background image into the design.
I know that we can define text variables and display these on the page template.
But what do we do if we have images that vary by publication, and we want to display one of those dynamic images on a location on the page?
For example, a cover image of the product or additional symbols or logos specific to the publication.
Is it possible to define an image variable that can be placed on the page layout design?
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
I am also interested in the answer to this question.
@Mike-E : there could be two possible solutions to this:
Option 1: if you know that all the maps are of type bookmap, then generally the images that should go on front page can be under frontmatter or some xpath under the bookmap xml
In this case, you can create a metadata field and use the xpath to the image and use it in the template page layout - check this document to know more about metadata fields
Option 2: if the map can be ditamap or bookmap, and lets say the image cannot be defined in the map xml then you may use User variable - defining the image path as variable in the output preset, steps as given below
The img tag you define in the variable has to literally be the tag. I was confused at first about this so I thought I would write a comment.
i.e.
@Mike-E Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
I'm sorry, but these explanations and examples aren't explicit enough for me. The screenshot above looks like it would work for a specific, unchanging image, but not for an image variable that would change for every map. It seems like there should be a way to define a keydef/keyref in the map for a cover_image and use that, but nothing I'm trying is working. I know how to define text as a language variable, but not the specific format for an image that would be defined within either a map or bookmap.
Hi @sschnelbach ,
My solution will work for dynamic images, they just need to be defined. Please note that these are not language variables, but just "Variables". See yellow highlight.
The different images can be defined by clicking on "settings" and naming the variations you need. See green highlight.
After you create the variations, you can switch between them by the drop down. See blue highlight. For each variation, define the different image tags you need. When you first create the variations, the cover variable will display the same value, but by switching between the variations through the blue highlighted dropdown, you can define all the cover images you need.
Now that these are defined, you can place the variable in a page layout. I have mine in a blank page because our covers images take up the entire page. I believe you can just drag and drop the variable in, but it's coded like this: <span data-keyref="Cover">Cover Image</span>
The last step is selecting the variation from the output preset on the map.
So if I want Cover X to be displayed, the variable set Cover X should be selected and the output pdf will display the image that you defined for it. This way every map can have its own preset with the correct cover image selected.
I think this solution will work for you, as the images can be defined differently for each map.
Views
Replies
Total Likes
Thanks @rkody
Adding to it
I am attaching screenshot with the step-by-step approach and sample variable set and PDF template to get started .
Step 1: Create your variable sets
Step 2: Add desired variable in your page layout ( I used "logo" variable")
Step 3 : While publishing select desired variable set in your preset and publish!
The attached Sample contains a sample template (where the variable is used ) , a Variable set, and images.
@sschnelbach Let me know how it goes for you
Thank you for the detailed answer. I'm still not getting it to work, but the Variable is selectable in the maps configuration. (It's just not appearing in the Native PDF Publishing PDF output.)
Unless I'm doing this incorrectly, which is entirely possible, this type of variable seems to be a global variable and not specific to each map in our system. We have hundreds of maps/product docs that would require different covers. A global cover image variable would work for fewer than a dozen different covers, but not for hundreds.
Please let me know if I completely misunderstood how to define this, but the variable I set up does appear as selectable in any map I opened in the XML Editor.
Views
Replies
Total Likes