Conditional image folder

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Conditional image folder

Unread post by John Johann »

How do I configure conditional folders?

Simplified details:
One XML document containing text and a link to a picture

Code: Select all

<para styleclass="Images"><image src="Image.Ending" scale="-75.00%" width="556" height="375" styleclass="Image Caption"></image></para>
Three folders containing images
Folder1=Small
Folder2=Medium
Folder3=Large

Custom builds -- SMALL, MEDIUM, LARGE

The three versions of the images have the same name -- just different quality depending on parent folder

How do I build the condition in the document for the different Project source paths per output?
Rainer Oehry
Posts: 102
Joined: Sun Dec 10, 2017 12:47 pm

Re: Conditional image folder

Unread post by Rainer Oehry »

I have the same problem with screenshot images for different languages.

As a workaround I have a powershell skript where I first copy the images for one version from their "repository" to the project search path folder, create the document, then copy the next set of images to the search path, call H&M again with the next task and so on.

What we need is the possibility to define the project search path for each publication task (as we can already do for the output format, filename and folder, builds, sets of variables etc.)
Regards,

Rainer
Head of Technical Writing & Knowledge Management
TIG Technische Informationssysteme GmbH, Rankweil, Austria
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Conditional image folder

Unread post by John Johann »

Hi Rainer,
That could be a possibility -- I was hoping to have an automatic set-up so that choosing the condition would do all the rest without me having to think about it.

It sounds like you have multiple languages in a single project -- how does that work for you? The advice here in the forum is more to avoid this.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Conditional image folder

Unread post by Tim Green »

Conditional image folders are not currently supported directly in Help+Manual, sorry. However, if you need this for WebHelp or CHM or EWriter you can achieve this with a skin with the help of the Toolbox Help+Manual power tools utility included in the Premium Pack, which allows you to enter alternative project search paths in the skin, which then overload the version in the project.

IMPORTANT: The skin must be stored in the same folder as the project you are publishing, otherwise it won't work! (The relative paths would then be wrong)

Suppose you have two image folders, img1 and img2, which should both be in the same parent folder. You would put default images in img1 and include only the img1 project search path in the project itself. Then you put the alternative images in img2, where they should have exactly the same names and dimensions as the versions in img1.

Then select the absolute project search path shown in the settings list and check the actual relative path stored, which will be shown below the box. For example, if the image folders are inside a folder called images, the relative path inside the project folder would look like this:

.\images\img1\

So then open the skin in Toolbox, select the Project Options button and add this to the Project Search Paths item:

.\images\img2\

Then save the skin with Toolbox. When you publish with that skin, the images will be sourced from img2 instead of img1. 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Conditional image folder

Unread post by John Johann »

I do like this forum!

I don't have the Premium Pack so that is something to look into.

I'm also a fan of the power of H&M to build help based on linking to a single style repository and single skin location (just in case there is a decision to use different styles/colours/layout ...).

At a current minimum of 35 CHM files (some of which have >1000 pages) + overall TOC to link them all, I'm hoping to set things up so that I only have to think about content.

Controlling the folders using VARIABLES is also not an alternative?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Conditional image folder

Unread post by Tim Green »

John Johann wrote:Controlling the folders using VARIABLES is also not an alternative?
Not a chance. Zero. Zilch. Nada. :mrgreen:
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: Conditional image folder

Unread post by John Johann »

So going back to the skin + alternative source paths.

Is it possible to apply multiple skins to the same project at the same time during publishing?

The idea being to have the standardised skin with all layout requirements and the secondary skin containing the use-case specific paths.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Re: Conditional image folder

Unread post by Martin Wynne »

Rainer Oehry wrote:As a workaround I have a powershell skript where I first copy the images for one version from their "repository" to the project search path folder, create the document, then copy the next set of images to the search path, call H&M again with the next task and so on.
Hi Rainer,

It would be easier simply to rename the folders?

\large\
\medium\
\small\

Rename each one to \in_path\ before running H&M and back afterwards.

Hi Tim, H&M could have a function to do this itself based on the build?

regards,

Martin.
Rainer Oehry
Posts: 102
Joined: Sun Dec 10, 2017 12:47 pm

Re: Conditional image folder

Unread post by Rainer Oehry »

Thank you, Martin, for your suggestion.

I had contemplated this solution too, but decided against it, because of a general risk involved and a specific situation I am confronted with:

I do not always have all screenshots in all languages at the time I have to produce certain documents. Some screenshots might exist in English only, others in German only (in fact, for some manuals, there are more than twenty different language versions …). So if a screenshot does not yet exist in, lets say, Hungarian (because the translation of the program itself has not yet been completed), we decided that it is better to have a screenshot in the wrong language than no screenshot at all. So I prefill the search folder with the english screenshots and then replace the files with the existing hungarian screenshots, leaving the english images in place to use whenever there was no hungarian screenshot available yet. Simply changing the folder name in this case would result in an image not found.
Of course I could have the german/hungarian/whatever folder as the first one and the English folder as the second one to check, so that the english image is used whenever no german one was found, but what if there is only a german picture and not an english one? Thanks to my copying "technique", I maximize the chance for at least having any picture found. By the way: English is not always the fallback language – the fallback language for traditional Chinese, as an example, is simplified Chinese and only then English, so in this case I first copy the english screenshots in to the search folder, then the simplified Chinese images and last the traditional Chinese images before producing the manual in traditional Chinese.

So what I could do is renaming more than one folder with \priority1, \priority2 etc. before any compilation run. The problem here is that I risk being left in an undefined situation whenever the batch stops for whatever reason and does not rename all folders back to a defined naming status.

I could of course have a backup, "shadow", repository with all folders that I could just use to copy over to the "working" folders … I will give this idea another thought, so thank you for your input!
Regards,

Rainer
Head of Technical Writing & Knowledge Management
TIG Technische Informationssysteme GmbH, Rankweil, Austria
Post Reply