I am working in a structured file using FM19, version 126.96.36.1996.
I am trying to add the ability to hide an element (shortdesc) for pdf output but everything in the dita file is being grabbed as well. Have I missed something in process here?
However, when I hit apply, the condition is applied to everything in the file including a draft comment. The Conditional Tags pod indicates that the shortdesc element is tagged with the shortdesc tag but oddly, the draft-comment element is also tagged with both DITA-Comment AND shortdesc tag. None of the other text in the file appears to have any Conditional Tag applied. In the Show/Hide Conditional Text pod, if I hide the shortdesc, everything in the file is hidden except for the draft-comment.
I hope that someone can help me out with my process or recommend another way to "hide" an element.
Try setting a value on the shortdesc element's outputclass attribute and change your expression to match that. See if it works then.
Thanks for your reply. In this case, I wanted the ability to hide ALL shortdesc elements in the pdf output so I really didn't want to add an outputclass to the hundreds of shortdesc elements. As a test, I did add an outputclass to the shortdesc and the same thing happened. Other thoughts?
I am not sure without seeing a document. You can send me one off list if you want: rick at frameexpert dot com
I think you have the logic backwards. Here is what I did to test:
1) I added an outputclass value of "hide" to my shortdesc element.
2) I created and applied this expression: NOT(outputclass="hide")
So, I am saying, "Show all the elements except those that have outputclass="hide".
This works for me. Give it a try with your criteria and see if it works. Thanks.
I tried it and that work! I still don't understand how my logic was backwards but clearly it was.
I was hoping that I wouldn't need to add an outputclass on the hundreds of these shortdesc element (and potentially other elements down the road) and that I could use the class that is already there but I can't seem to get it to work when using the class. Any other thoughts on how to hide an element without adding an outputclass?
You can do something like this: Edit > Find/Change, choose Element:
Set the Change value to the value you want to use.
You could also use a simple XSLT stylesheet that would automatically set the attribute value whenever you open a topic. If you are interested in trying this, please let me know.
Thank you so much for digging into this and the suggestions on how to add outputclasses on! I really thought that there had to be away to grab the element by the class either using Conditional Tags and Show/Hide or ditaval. If outputclass is the only way to go, I guess I will have to go that route.
Using outputclass is totally arbitrary on my part. You could use platform, product, otherprops, etc.; whatever makes sense for you. You should be able to use the class but only if it is explicitly set in FrameMaker. When I create a new topic in FrameMaker, the class attributes don't have values on them.
What you do depends on your workflow. If you are mainly using FrameMaker and always want one of the attributes populated for a particular element, you can have an XSLT stylesheet automatcially applied when you open a topic.
We are evolving in our process and so we are using outputclass, platform, product and otherprops for other things and the parts are constantly moving which is why I thought grabbing the class would be perfect and it would stay out of the way. The shortdesc class is alway "- topic/shortdesc\ " for our products. Is there a problem with the format of the class attribute that I am putting it in to build the experession? (I tried "- topic/shortdesc\ " as well).
Your expression doesn't look correct. I think it should be
What you suggested is not working either. Any other thoughts?
Open up the structure view with the attributes showing for your shortdesc element and post a screenshot. Thanks.
Is this what you wanted?
Yes, I wanted to make sure that your class attribute is explicity set. Let me try something here.
I am not sure what the problem is. I am getting it to work here:
If you want to do a quick web meeting so I can see your set up, please contact me offlist. There will be no cost for the meeting. rick at frameexpert dot com
Thanks so much Rick! Looks adding that trailing space after the class attribute did the job!
Hey Rick, this may be a stupid question but how do I import the new attribute filters in the template so that it will be applied to the whole project? I thought I could just import the file that you got working by using File>Import Formats but it is not working. Then I thought I would just recreate the process on the Template but I get the following message. Thought?
Hi Leigh, Please move the message box so I can see the expression. I may not answer this right away because I am leaving the office. I will check it when I get back. Thanks. -Rick
In the Template, when I imported from the working file, the Template appeared to have the shortdesc tag so I thought all was well but then I realized it wasn't working. I opened the Filter by Attribute pod and "Hide" was selected under Filtered Text (even the "hide" was not working). I thought I could just Apply the conditional tag for the shortdesc. This is when I got the "Invalid Expression" message.
When I looked at the Build Expression window, you can see that the Attributes option window is blank.