Skip to main content
Participating Frequently
October 17, 2013
Answered

Conditionally build script

  • October 17, 2013
  • 1 reply
  • 509 views

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!

This topic has been closed for replies.
Correct answer RoboColum_n_

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.

1 reply

RoboColum_n_
RoboColum_n_Correct answer
Legend
October 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.

hill_gwwAuthor
Participating Frequently
October 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

Peter Grainge
Community Expert
Community Expert
October 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

Use the menu (bottom right) to mark the Best Answer or Highlight particularly useful replies. Found the answer elsewhere? Share it here.