4 Replies Latest reply on Oct 18, 2013 4:19 AM by hill.gww

    Conditionally build script

    hill.gww

      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!

        • 1. Re: Conditionally build script
          RoboColum(n) Level 5

          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.

          • 2. Re: Conditionally build script
            hill.gww Level 1

            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

            • 3. Re: Conditionally build script
              Peter Grainge Adobe Community Professional (Moderator)

              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

              1 person found this helpful
              • 4. Re: Conditionally build script
                hill.gww Level 1

                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.