Adding a graphic to a page layout - can I use a variable?

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Adding a graphic to a page layout - can I use a variable?

Post by ChoccieMuffin »

Hi all

I''ve had a trawl through the Flare help and couldn't find anything helpful for this, so thought I'd ask you lovely people. I haven't messed about with my page layouts for years, so I'm extremely rusty in this department too.

We use lots of GPL, and I would like to do this:

In my globals project on the Front Cover page layout include a graphic.

Not quite sure how to do this, even. So far I've added a decoration frame that bleeds over the edge of the page, press F2 and in the Frame Contents pane at the bottom inserted an image. Did I get that bit right? How do I define that it should fit in the space allowed, so I can use a high-def picture?

Is there any way that rather than specifying a specific graphic? Can I insert a variable or whatever, so that the graphic changes depending on the project the page layout is imported into, as long as the projects all contain a graphic called "frontpage.png" for example?
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Chicago_HPT
Sr. Propeller Head
Posts: 133
Joined: Sun Feb 03, 2013 6:01 pm

Re: Adding a graphic to a page layout - can I use a variable

Post by Chicago_HPT »

I don't know about a variable, but I think you should be able to insert images into a frame and then apply conditions that you can include or exclude at the target level. Or, you should be able to add multiple images to a snippet and apply conditions to those images within the snippet. Insert the snippet and then include or exclude snippet conditions at the target level. Then you can control which images display and which are hidden, based on the target.

I hope that helps,
-jeff
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Adding a graphic to a page layout - can I use a variable

Post by NorthEast »

If the image is going to be the same for all the targets in a single child project, then you could link it to frontpage.png in your global project, and then just replace frontpage.png in your child projects.

That's what I do - I include a default cover image with my global project/template, but anyone using the template can just replace that image in their own child project.

You'd only need to use multiple images and conditions in the page layout, if you need to use different images for the targets within a single child project. For example, you have a project where target A needs to use one cover image, but target B needs to use a different image. Note that with this approach, you can't apply conditions to background images, so the images would have to be in the content of a decoration frame (not the background of the frame itself).
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Adding a graphic to a page layout - can I use a variable

Post by ChoccieMuffin »

Dave Lee wrote:If the image is going to be the same for all the targets in a single child project, then you could link it to frontpage.png in your global project, and then just replace frontpage.png in your child projects.

That's what I do - I include a default cover image with my global project/template, but anyone using the template can just replace that image in their own child project.

You'd only need to use multiple images and conditions in the page layout, if you need to use different images for the targets within a single child project. For example, you have a project where target A needs to use one cover image, but target B needs to use a different image. Note that with this approach, you can't apply conditions to background images, so the images would have to be in the content of a decoration frame (not the background of the frame itself).
Thanks. I'm assuming that I would also EXCLUDE frontpage.png from all of my globals.flimpfl files?

And finally, how do I make it that the png file I use is nice and big (so it's not pixelated) but the whole thing fits in the space allowed on the page layout? I'm having a bit of brain freeze as I just can't work it out! Thanks.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Adding a graphic to a page layout - can I use a variable

Post by NorthEast »

ChoccieMuffin wrote:Thanks. I'm assuming that I would also EXCLUDE frontpage.png from all of my globals.flimpfl files?

And finally, how do I make it that the png file I use is nice and big (so it's not pixelated) but the whole thing fits in the space allowed on the page layout? I'm having a bit of brain freeze as I just can't work it out! Thanks.
I don't exclude it from my import, as I initially want the default image to be copied to the child project. But the image can be replaced in the child project afterwards if required.

For my page layout cover, I use my image in a decoratation frame as a background image, and set Repeat to Stretch.

If your image is pixelated, then you just need a higher resolution image - Flare can't fix that for you.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Adding a graphic to a page layout - can I use a variable

Post by ChoccieMuffin »

Dave Lee wrote:
ChoccieMuffin wrote:Thanks. I'm assuming that I would also EXCLUDE frontpage.png from all of my globals.flimpfl files?

And finally, how do I make it that the png file I use is nice and big (so it's not pixelated) but the whole thing fits in the space allowed on the page layout? I'm having a bit of brain freeze as I just can't work it out! Thanks.
I don't exclude it from my import, as I initially want the default image to be copied to the child project. But the image can be replaced in the child project afterwards if required.

For my page layout cover, I use my image in a decoratation frame as a background image, and set Repeat to Stretch.

If your image is pixelated, then you just need a higher resolution image - Flare can't fix that for you.
We have automatic re-imports going on, so I think I may have to rethink the approach, and have a separate page layout per product, each one with a different graphic, then get the TOCs in each of the child projects to use the appropriate product-specific page layout. It'll need a little bit of tweaking of my 40ish child projects, but at least it'll be obvious to my tiny brain that anything to do with page layouts will need to be changed in the globals project (which kinda makes sense).

Thanks for your help, I'll need to do a bit more playing and then I'll be a happy camper.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Adding a graphic to a page layout - can I use a variable

Post by NorthEast »

ChoccieMuffin wrote:We have automatic re-imports going on, so I think I may have to rethink the approach, and have a separate page layout per product, each one with a different graphic, then get the TOCs in each of the child projects to use the appropriate product-specific page layout. It'll need a little bit of tweaking of my 40ish child projects, but at least it'll be obvious to my tiny brain that anything to do with page layouts will need to be changed in the globals project (which kinda makes sense).

Thanks for your help, I'll need to do a bit more playing and then I'll be a happy camper.
Why would you need to have a separate page layout per project? You don't need to, if the only difference is the image.

If the image is only different per child project (i.e. the same image can be used for all targets in the child project), then you only need one page layout. Then in each child project, if you need to use an image that's different to the imported image (from your global project), you just replace the image PNG file in the child project. Flare will ask you if you want to remove it from the import, and it'll add it to the Removed Links, so it won't get overwritten on subsequent re-imports.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Adding a graphic to a page layout - can I use a variable

Post by ChoccieMuffin »

Dave Lee wrote:
ChoccieMuffin wrote:We have automatic re-imports going on, so I think I may have to rethink the approach, and have a separate page layout per product, each one with a different graphic, then get the TOCs in each of the child projects to use the appropriate product-specific page layout. It'll need a little bit of tweaking of my 40ish child projects, but at least it'll be obvious to my tiny brain that anything to do with page layouts will need to be changed in the globals project (which kinda makes sense).

Thanks for your help, I'll need to do a bit more playing and then I'll be a happy camper.
Why would you need to have a separate page layout per project? You don't need to, if the only difference is the image.

If the image is only different per child project (i.e. the same image can be used for all targets in the child project), then you only need one page layout. Then in each child project, if you need to use an image that's different to the imported image (from your global project), you just replace the image PNG file in the child project. Flare will ask you if you want to remove it from the import, and it'll add it to the Removed Links, so it won't get overwritten on subsequent re-imports.
Only just saw this.

By "Product" I mean a company-specific product (not a Flare project). We have about 5 different "products", so even though we have 40+ Flare projects we'd only need about 5 different page layouts, and the Flare projects would be associated with the correct page layout, depending on which company product it relates to. I can even apply product-related conditions to the page layouts to ensure that the Flare projects only import the page layout and graphic that it needs, and not the stuff for other company products.

It's all on the back burner at the moment as I'm getting ZERO feedback from those who will ultimately make the decision on what they think of what I've done so far. But that's pretty much the norm. Until, of course, they have a brilliant idea right when I'm up against stuff and a deadline is looming, but I know I don't even need to mention this as you lovely people will be very familiar with this kind of thing!
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
oleksandr_kokoshyn
Propeller Head
Posts: 27
Joined: Mon Sep 03, 2018 4:19 am

Re: Adding a graphic to a page layout - can I use a variable

Post by oleksandr_kokoshyn »

You can use variables in image source paths like this:

Code: Select all

<img src="../_resources/graphics/frontmatter/[%=doc_props.front_img%]" />
In the example above, I'm using the front_img variable from the doc_props variable set.
The front_img values can either be filenames (product01.png, product02.png, etc.) that you select in targets, or front_img can have references to product-specific variable sets.
For example, in your Flare project you can define unique ids for each product, something like:

Code: Select all

prod01, prod02, prod03
  • Create variable sets with names matching those ids.
  • Create a variable called prod-id in the doc_props variable set.
Each set must contain the same variables (the way I do it: I create one set and then copy it).
Call one variable in the product-specific set page_layout_img.
Then you can put such a value in front_img:

Code: Select all

[%=[%=doc_props.prod-id%].page_layout_img%]
Now in your targets, you only have to select the prod-id value.
In product-specific sets, you can also put the real product names (and then create a variable doc_props.prod_name with the value [%=[%=doc_props.prod-id%].name%]), as well as other product-specific values.

I was writing this without looking at my Flare project, so please let me know if this does not seem to make sense :)
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Adding a graphic to a page layout - can I use a variable

Post by ChoccieMuffin »

Thanks Oleksandr, a very thorough explanation - I thought there should be some way to do it!

As it turns out, after all of that, the point is moot as they've decided that all docs should just have the same front cover (apart from text variables) so I don't need to do this, but I'm very grateful for your input.
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Post Reply