Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Conditionally build script

New Here ,
Oct 17, 2013 Oct 17, 2013

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!

528
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Oct 17, 2013 Oct 17, 2013

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.

Translate
LEGEND ,
Oct 17, 2013 Oct 17, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 17, 2013 Oct 17, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2013 Oct 18, 2013

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

@petergrainge

Help others by clicking Correct Answer if the question is answered. Found the answer elsewhere? Share it here. "Upvote" is for useful posts.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 18, 2013 Oct 18, 2013
LATEST

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. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp