Tailorung a skin - behavior of "All toggles" handle

Please post all questions on Help+Manual 8 here

Moderators: Alexander Halser, Tim Green

Post Reply
chfrmeyer
Posts: 63
Joined: Tue Sep 21, 2010 5:07 pm

Tailorung a skin - behavior of "All toggles" handle

Unread post by chfrmeyer »

I've adapted a skin supplied with Help&Manual (or premium pack?) (CHM Skin, Light Grey Header, Feature Images.hmskin) to suit my preferences.

I appreciate the navigation arrows in the topic header and with some trial and error changed the code to display any of the arrows (prev/up/next) only if a previous or parent or next topic actually exists (not just show a darkened arrow).

I also appreciate the feature for displaying or hiding all toggles in a topic - particularly if the topic contains more that one toggle. With only one toggle it sometimes is a nuisance.

The code for "all toggles" I locate as such:

<!-- The following code displays Expand All/Collapse All links below the header in topics containing toggles -->
<div id="switchtoggles"><IF_TOGGLES><a href="javascript:HMToggleExpandAll(!HMAnyToggleOpen())" title="Klicken Sie hier, um alle aufklappbaren Abschnitte (z. B. Abbildungen) zu öffnen/zu schließen">Alle ein/ausblenden </a></IF_TOGGLES></div>

How could the code be modified in the sense of something like "IF_TOGGLES_greater_1" instead of just "IF_TOGGLES"?

A more tedious method would be to copy my page template (or both of them, I already use two of'em) so that one set of templates includes the "expand all toggles" feature and the other does not, and then specifically assign a page template with that ferature to specific topics, if there is no more convenient way, which I doubt.

The attached image should help illustrate what I'm talking about.
You do not have the required permissions to view the files attached to this post.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Tailorung a skin - behavior of "All toggles" handle

Unread post by Tim Green »

Hi Christof,

This is one of the standard skins included with Help+Manual. The Premium Pack skins are always stored in a subfolder with the Premium Pack name and version number inside the Templates\HTML Skins\ folder in the Help+Manual program directory. You'll get a lot more options in CHM with those skins.

It's easy to hide the toggle toggles link based on the number of toggles on the page. Edit the HTML Page Template in the skin and locate these lines of code down towards the end of the file:

Code: Select all

			});                   
                   </IF_TOPIC_PICTURE>
		});
</script></IF_TOPIC_HEADER>
Then add the following two lines after the closing </IF_TOPIC_PICTURE> tag:

Code: Select all

			});                   
                   </IF_TOPIC_PICTURE>
		var $dtoggles = $("a.dropdown-toggle");
		if ($dtoggles.length < 3) $("div#switchtoggles > a").hide();
		});
</script></IF_TOPIC_HEADER>
I've set it to hide the link if there are fewer than 3 toggles. You can change it to fewer than 2 if you like. Note that this only counts the drop-down toggles. It ignores any inline text toggles, if there are any on the page. Those are also toggled by the function, whereas image toggles aren't.
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.
chfrmeyer
Posts: 63
Joined: Tue Sep 21, 2010 5:07 pm

Re: Tailorung a skin - behavior of "All toggles" handle

Unread post by chfrmeyer »

Thanks for your tip. I have not tried yet but certainly intend to do so.

Right now I'm attending to another issue: The skin is intended for use by a set of projects from which publishing to CHM are done automatically on a build server. So far we have not managed to get an export done with the skin - the resulting CHM file had the "unskinned" appearance.

The (your) online help on "H+M command line syntax" > "/O=<filename>" includes the sentence "Note that the use of .hmskin skins is intended for HTML output only". That makes us wonder whether that means that skins for HTML (CHM) Help can only assigned manually rather than by command line (Interpretation of this sentence depends on whether "HTML output" is meant in a narrower or broader sense, also on whether only command-line publishing is meant or manual publishing as well).

A restriction to manual publishing instead of command-line publishing for CHM output sounds more confusing than logical...
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: Tailorung a skin - behavior of "All toggles" handle

Unread post by Tim Green »

So far we have not managed to get an export done with the skin - the resulting CHM file had the "unskinned" appearance.
That just means that your reference to the CHM skin was incorrect, i.e. Help+Manual did not find the skin. Note that when you are using command line compiling the root folder is the folder containing the project you are compiling. If you reference the skin with a relative path, it must be relative to the project folder. Also don't forget to enclose the path in double quotes if it contains any spaces. 8)
whether "HTML output" is meant in a narrower or broader sense, also on whether only command-line publishing is meant or manual publishing as well).
It's meant in the broader sense: CHM, WebHelp and eWriter. The only exceptions are Kindle and ePub eBooks. Those are also HTML, but not really since eBook viewers use extremely primitive HTML engines that cannot be compared to modern browser HTML. :?
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.
chfrmeyer
Posts: 63
Joined: Tue Sep 21, 2010 5:07 pm

Re: Tailorung a skin - behavior of "All toggles" handle

Unread post by chfrmeyer »

Thanks a lot.
The 2 lines for defining a minimum number of toggles are working fine, and your other answers about the issue of assigning the skin on a "Build server" context have been helpful.

Best regards
Post Reply