Advise on scripting

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Wanaka
Jr. Propeller Head
Posts: 9
Joined: Mon Oct 05, 2020 5:13 am
Location: France

Advise on scripting

Post by Wanaka »

Hello,

I get in trouble and I would need your advice... :roll:

For a product manual, 95% of the information works perfectly with some conditions.

But as each manual is for a project, some parts are dedicated to the project (ex: the picture on the cover page of the manual).
At the beginning, I added a condition for each project, but we get more and more project, and I don't want to create hundreds of conditions (as hundreds of projects), just for one topic...

At the moment, as temporary solution, I have a specific TOC for each project as +/- 10 topics are specific to the project.
But it means hundreds of TOC as well in the futur => not the good solution! :evil:

So my idea would be to use a variable (with the project name), and have a dynamic link for my picture as following:
C:\Heremypath\Resources\**VariableWithProjectName**\cover.jpg
With this solution, I create a specific folder for each project, and my cover picture get always the same name…

Do you this this could be a good solution?
If yes, I have no idea how to set up this solution (for the scripting part). Can you give me some ideaas, so I can search for the solution?
Thanks a lot for your help! :lol:
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Advise on scripting

Post by robdocsmith »

I've not tried this and this post is from 2014 so the issues reported may no longer apply, but the below post talks about addressing an image using a madcap variable instead of a direct src link.
viewtopic.php?f=75&t=26687
At the time it didn't show properly in the editor but did show in preview and output.

Rob
Wanaka
Jr. Propeller Head
Posts: 9
Joined: Mon Oct 05, 2020 5:13 am
Location: France

Re: Advise on scripting

Post by Wanaka »

Hi robdocsmith ,

Sorry for my late answer, I was on hollidays... :-)
Thanks a lot for your feedback, and let's try if your post is still working!

Have a nice day!!
Wanaka
Jr. Propeller Head
Posts: 9
Joined: Mon Oct 05, 2020 5:13 am
Location: France

Re: Advise on scripting

Post by Wanaka »

Hi,

I do a quick feedback as it can helps...
It seems the previous solution doesn't work anymore, if I did everythings well:
<p><img src="<MadCap:variable name="SpecificVariables.Couleur"" /></p>
=> error message "The file could not be loaded. '<', the hexa value is not valid...

Thanks a lot anyway, and if someone has a solution, I'm still interrested...
devjoe
Sr. Propeller Head
Posts: 337
Joined: Thu Jan 23, 2014 1:43 pm

Re: Advise on scripting

Post by devjoe »

When you use a variable as an attribute, rather than as document text, you need to use the [%=...%] format. You've probably seen this in your TOC as [%=System.LinkedTitle%] when you let it reference the linked topic's title, but you can use the same format to reference a variable as an HTML attribute in topics.
Post Reply