Copy link to clipboard
Copied
Hi, I want to put some redirection code into my help stsytem, is it possable to conditionally build a <script type="text/javascript"> tag?
Any help would be much appricieated
oooo and meta tags as well!
Are you wanting to add a Javascript inside a topic and then conditionalise it so it only appears in some outputs? If so, check out this part of the help for adding scripts. Once it is in, you should be able to add a conditional build tag to exclude it from the required outputs.
I'm not sure you can conditionalise meta tags though. Perhaps if you can tell us a little more about what you are trying to achieve.
Copy link to clipboard
Copied
Are you wanting to add a Javascript inside a topic and then conditionalise it so it only appears in some outputs? If so, check out this part of the help for adding scripts. Once it is in, you should be able to add a conditional build tag to exclude it from the required outputs.
I'm not sure you can conditionalise meta tags though. Perhaps if you can tell us a little more about what you are trying to achieve.
Copy link to clipboard
Copied
hi, thanks for the reply, i was adding the script manually in the head, so i couldn't see the little red box to tag.
RE meta tags, i want to use shorter titles for the phone version of the project, i think using a variable is the best way to achieve this, and its far from the end of the world if it doesn't work!
A follow up question, can you conditionally buld an inline style, for example a font colour...so that it would be only that colour on the phone version, again this is not vital as i can just use 2 css files.....just thought it could have its uses
Copy link to clipboard
Copied
You are referring to topic titles but I think you mean topic headings, as seen by the user at the start of a topic rather than the title in topic properties.
Enter both and use conditional build tags.
Same for font colours although a different CSS might be easier for this one.
See www.grainge.org for RoboHelp and Authoring tips
Copy link to clipboard
Copied
I thought that would be the case, i was actually meaning the metatag title, although I don't think i was thinking properly.
I have come across an issue with the origional solution, when i switch to HTML view and then back to design the tag goes from the working <?rh-cbt_start condition xxx> to a style="x-condition: xxx;" inside the script tag, i have the same problem when i put style="max-height: 1000px;" in the cbt tags, it works if i stay out of HTML view, which I am very bad at doing.