8 Replies Latest reply: Nov 6, 2014 10:22 AM by KKHoff RSS

    keys

    Engineer/technical writer Community Member

      Hey,

      I'm trying to use keys as variables in my DITA project, but I can't figure out how to insert a "variable" in a topic using keys?

       

      This is what my dita map looks like:

       

      <map xmlns:ditaarch = "http://dita.oasis-open.org/architecture/2005/">

           <title>Product variables</title>

                <keydef keys = "product_name">

                     <topicmeta>

                          <keywords>

                                   <keyword>Sample Product Name</keyword>

                          </keywords>

                        </topicmeta>

                   </keydef>

      </map>

       

      This is what the topic looks like but nothing happens

       

      <concept id = "id144FF0W0FFP"

          xmlns:ditaarch = "http://dita.oasis-open.org/architecture/2005/">

      <title>General description</title>

           <conbody>

                <p><keyword keyref = "product_name"></keyword> is a great product.</p>

           </conbody>

      </concept>

       

      Can anyone help me?

        • 1. Re: keys
          KKHoff

          I'm having the same problem - working in Framemaker12. Did you find an answer? Thanks!

          • 2. Re: keys
            Engineer/technical writer Community Member

            Hi KKHoff,

             

            I tried doing this with the DITA-FMx 2.0, trial version, and it worked without any problems.

            But I have no answer for regular FM12.

             

            Best regards
            Ronny

            • 3. Re: keys
              saprentice Community Member

              I haven't tested this recently, but I believe that the only feature of keys that works in default FM is when used to specify a keydef/@href value.

               

              Keydefs that specify content (as in the example above) should work fine in DITA-FMx 2.0 as well as key-based glossary references. Also, keyspaces in FMx can take ditaval filtering into account (also not supported in default FM).

               

              Cheers,

               

              Scott Prentice

              Leximation, Inc.

              www.leximation.com

              • 4. Re: keys
                KKHoff Community Member

                Thanks Ronny and Scott! It's too bad that framemaker does not support keyrefs fully out of the box. Is there maybe a way to "customize" framemaker12 to make this feature work by tweaking the EDD and the read/write rules?

                • 5. Re: keys
                  saprentice Community Member

                  It requires some "heavy lifting" from an FDK plugin, so unless you're going to create one yourself I think your only choice is DITA-FMx.

                   

                       http://leximation.com/dita-fmx/

                   

                  Cheers,

                  …scott

                  • 6. Re: keys
                    KKHoff Community Member

                    Thanks Scott.

                    I ended up doing the following:

                    1. In a key map define a key "prod-name" with an href to a topic that includes all my variables, such as product names etc.. wrapped in a <ph> element with  id="product-name"
                    2. In the topic, insert a conkeyref to the key "prod-name" and select the <ph> element with id product-name

                     

                    This resolves the keyref in the topic when shown in the fm editor. However: The topic is part of a map, and when I save the map to composite fm (to print as pdf later), the keyref disappears. So somehow the keyref gets lost when framemaker applies the ditabase struct app. Is there maybe a setting I overlooked?

                     

                    Kathrin

                    • 7. Re: keys
                      KKHoff Community Member

                      One additional comment: Simply using conref instead of conkeyref resolves the reference correctly in the  topic and composite fm created from the map that contains the topic.

                      So the conclusion for now  is that even keyrefs to files don't work in framemaker because it is not possible to resolve them in map output.

                      • 8. Re: keys
                        saprentice Community Member

                        Hi Kathrin...

                         

                        That sounds like a bug.

                         

                        I'd push things back to the basics. Try just using a conref rather than a conkeyref to start.

                         

                        1) Create a new topic file (not part of the map or your deliverable), give it a title like "variables", then insert ..

                         

                             <p>Prodname: <ph id="product-name">PRODUCT NAME</ph></p>

                         

                        2) In your content file (the DITA topic that's part of your map), insert a conref to that "variable" ..

                         

                             <p><ph conref="variablefile.xml#shared/product-name"></ph> is a great product!</p>

                         

                        3) Test that in the source and see if it publishes properly. If it does, try creating a keydef that points to the variables file and insert a conkeyref that points to the element.

                         

                        map:

                             <keydef keys="prod-name" href="variables.xml"/>

                         

                        topic:

                              <p><ph conkeyref="prod-name/product-name"></ph> is a great product!</p>

                         

                        Both the conref and conveyref should work .. if the conkeyref doesn't, it's a bug.

                         

                        Cheers,

                         

                        …scott

                        • 9. Re: keys
                          saprentice Community Member

                          OK .. sounds like you should use a conref rather than a conkeyref. (Or use DITA-FMx .. :-o )

                           

                          …scott

                          • 10. Re: keys
                            KKHoff Community Member

                            Yes, I guess I will use conrefs and add this to my business case for purchasing dita-fmx...

                            Thanks for your help!