Topic prefix
Moderators: Alexander Halser, Tim Green
-
- Posts: 305
- Joined: Mon Aug 21, 2017 7:35 pm
Topic prefix
Hi,
Is there a global variable for the Miscellaneous Option "Prefix" that can be automatically added to the topic ID?
Thanks
Is there a global variable for the Miscellaneous Option "Prefix" that can be automatically added to the topic ID?
Thanks
- Tim Green
- Site Admin
- Posts: 23181
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Topic prefix
Hi John,
This isn't available in Help+Manual itself but you can do this with the Toolbox power tools utility included with the Premium Pack add-on:
http://www.it-authoring.com/info/pp3hel ... fixes.html
https://www.helpandmanual.com/products_hm_pluspack.html
This isn't available in Help+Manual itself but you can do this with the Toolbox power tools utility included with the Premium Pack add-on:
http://www.it-authoring.com/info/pp3hel ... fixes.html
https://www.helpandmanual.com/products_hm_pluspack.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.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 305
- Joined: Mon Aug 21, 2017 7:35 pm
Re: Topic prefix
Hi Tim,
Thanks -- I'm not trying to set it -- I do that manually -- I want to get the value which I set myself out of the prefix field for use somewhere else.
Thanks -- I'm not trying to set it -- I do that manually -- I want to get the value which I set myself out of the prefix field for use somewhere else.
- Tim Green
- Site Admin
- Posts: 23181
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Topic prefix
There's no explicit interface or variable for that. The only way to get that would be to parse the XML of the .hmxp file and get it from there.John Johann wrote:Thanks -- I'm not trying to set it -- I do that manually -- I want to get the value which I set myself out of the prefix field for use somewhere else.
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.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 206
- Joined: Thu Jul 13, 2017 2:57 pm
Re: Topic prefix
If you want it at run-time in CHM or WebHelp you might get it from the document URL:John Johann wrote:I want to get the value which I set myself out of the prefix field for use somewhere else.
Code: Select all
document.URL.substring(1+document.URL.lastIndexOf('/')).split('_')[0]
-
- Posts: 305
- Joined: Mon Aug 21, 2017 7:35 pm
Re: Topic prefix
Thanks.
I have a CHM template which I use in a run-time merged set-up. The first topic in each child is a centred image which the user can click on to get to the intro. The image e.g. ABC_image.png is identified by the abbreviation of the child project. I was hoping to automate the "ABC_" with a nice little variable. The Miscellaneous options prefix field itself doesn't allow me to define a user-defined variable.
I have a CHM template which I use in a run-time merged set-up. The first topic in each child is a centred image which the user can click on to get to the intro. The image e.g. ABC_image.png is identified by the abbreviation of the child project. I was hoping to automate the "ABC_" with a nice little variable. The Miscellaneous options prefix field itself doesn't allow me to define a user-defined variable.
-
- Posts: 206
- Joined: Thu Jul 13, 2017 2:57 pm
Re: Topic prefix
I just tried this in the browser and you can script it:John Johann wrote:Thanks.
I have a CHM template which I use in a run-time merged set-up. The first topic in each child is a centred image which the user can click on to get to the intro. The image e.g. ABC_image.png is identified by the abbreviation of the child project. I was hoping to automate the "ABC_" with a nice little variable. The Miscellaneous options prefix field itself doesn't allow me to define a user-defined variable.
Code: Select all
// quick hack, should be all on one line - use variables to clean this up for production
document.getElementById("myID").src = document.getElementById("myID").src.split('_')[0] + document.URL.substring(1+document.URL.lastIndexOf('/')).split('_')[0] + "_" + document.getElementById("myID").src.split('_')[1]
- image has id='myID'
- image src filename as used in H+M source code begins with underscore, so will be published as e.g. src='/path/to/_myimage.png'
- image path does not contain underscores, e.g. src='/path_to/_myimage.png' wouldn't work because code will split it at the underscore between 'path' and 'to'
- prefix for project ends with underscore, e.g. 'abc_' so topics will be published as e.g. 'https://mysite.com/help/abc_mytopic.html'
- you want to prepend the prefix to the src filename, e.g. to make src='/path/to/abc_myimage.png'
-
- Posts: 305
- Joined: Mon Aug 21, 2017 7:35 pm
Re: Topic prefix
I was looking into this again and found that I can automate the image in the CHM.
To do so, I defined another variable with the same content as the topicprefix in the Miscellaneous options.
Some inline html code with the image source --> <img src="<%T_PREFIX%>option_cover_800.png" width=...
outputs the image from the baggage as desired.
For PDF output, I have a separate topic where I would like to achieve the same. Html code isn't going to work there of course. Simply changing the image src to the variable doesn't work either.
Any suggestions?
To do so, I defined another variable with the same content as the topicprefix in the Miscellaneous options.
Some inline html code with the image source --> <img src="<%T_PREFIX%>option_cover_800.png" width=...
outputs the image from the baggage as desired.
For PDF output, I have a separate topic where I would like to achieve the same. Html code isn't going to work there of course. Simply changing the image src to the variable doesn't work either.
Code: Select all
<para styleclass="Normal"><image src="ABC_option_cover.png" scale="-100.00%" width="2013" height="1995"></image></para>
<para styleclass="Normal"><image src="<%T_OPTION_COVER%>" scale="-100.00%" width="2013" height="1995"></image></para>
- Tim Green
- Site Admin
- Posts: 23181
- Joined: Mon Jun 24, 2002 9:11 am
- Location: Bruehl, Germany
- Contact:
Re: Topic prefix
Hi John,
You can't set the image source with a variable at the moment. That would involve resolving the variable at edit time to display the image in the editor and that isn't currently supported. The only option here for PDF would be to use conditional text tags and a choice of different images. That's a little clunky because then you always see all the images in the editor, but I'm afraid that's the only way to do it at the moment.
You can't set the image source with a variable at the moment. That would involve resolving the variable at edit time to display the image in the editor and that isn't currently supported. The only option here for PDF would be to use conditional text tags and a choice of different images. That's a little clunky because then you always see all the images in the editor, but I'm afraid that's the only way to do it at the moment.
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.
Tim (EC Software Documentation & User Support)
Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
-
- Posts: 305
- Joined: Mon Aug 21, 2017 7:35 pm
Re: Topic prefix
Hi Tim,
Thanks for the answer.
I don't actually need to see the image -- I can't see it in the HTML variant either. I'd be happy enough if the variable for the image is resolved on publishing the PDF the same as when it is just inserted in a text.
Thanks for the answer.
I don't actually need to see the image -- I can't see it in the HTML variant either. I'd be happy enough if the variable for the image is resolved on publishing the PDF the same as when it is just inserted in a text.