2 Replies Latest reply on Feb 6, 2009 12:29 PM by RoboWizard

    Attribute-value support?

      I would like to do something in RH8, but I don't see a way. Perhaps through user-defined variables, but I don't really see how variables do much more than snippets. Conditions don't seem to apply here either. I would like to define a global attribute, such as 'Product'. Then, the attribute would have different values: 'ProductA', 'ProductB', etc. Then, I would apply the attribute to different topics, selecting different values for each topic. Ultimately, I would like to insert a snippet or variable at the top of a topic, that says, "Applicable Products: "x, y, z". The 'x, y, z' would be a list of products this topic applies to. This list can change over time, but instead of manually updating the topic, I would just update the topic's values for the 'Product' attribute, and the snippet in the topic would update itself. Any ideas?
        • 1. Re: Attribute-value support?
          MergeThis Level 4
          It seems that snippets would do the job; you'd create a snippet for each combination of "x,y,z," "y,z," "x,y," etc., and then insert the snippets in the proper topics.

          If the value of "y" changes, you would, of course, have to change the value in each snippet that contains "y." Therefore, you'd usually be editing only a handful of snippets at any one time.

          Keeping track of their usage is easy: right click the snippet, and select Properties > Used In, or select Tools > Reports > Snippets.

          Good luck,
          • 2. Re: Attribute-value support?
            RoboWizard Level 4
            Hi there

            It would seem you should be able to accomplish this using a combination of variables and snippets and maybe even Conditional Build Tags.

            First off, allow me to try and clarify the difference between snippets and variables.

            Maybe you have a standard disclaimer that you have to repeatedly type out every time you insert some code. Perhaps your application always has the user making changes to the Windows Registry. If you are a good do-bee, you know you should insert a disclaimer with each occurrence. Perhaps a note admonishing the user that it's a good idea to maintain a backup of the registry in case they corrupt it and they are on their own if they don't have a backup. Something like this. So this could exist on 40 or 50 pages. Instead of repeatedly and laboriously typing it out on each page where it's needed, you define a snippet. Then when it's time to add a new hack, you just type the hack and insert the reference using the snippet. The great part of it is that if you ever wish to amend the verbiage, you only have to update the snippet.

            With Variables, in all RoboHelp HTML classes I conduct, I always advise there are two that are good candidates. Company Name and Company Acronym. With these, you define the variable(s) in the pod and assign an initial value to it. When you prepare to generate the output, you have the opportunity to change that value and see it reflected anywhere you used the variable.

            You are able to insert a variable into a snippet. For example, Company A (the variable) recommends you back up your registry... But you can't insert a snippet into a variable. See the difference?

            Cheers... Rick