Highlighted

Manage Attribute Expression selects too much

New Here ,
Jul 01, 2020

Copy link to clipboard

Copied

I am working in a structured file using FM19, version 15.0.6.956.

 

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?

  1. In the Conditional Tags pod, I added a conditional tag for shortdesc.
  2. I then went to the "Manage Attribute Experssions" and created a new expression: shortdesc
  3. leighb61493055_0-1593627314953.png
  4. I applied the shortdescr conditional tag
  5. leighb61493055_1-1593627459855.png

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.

 

Thanks.

 

 

TOPICS
PDF output, Publishing, Structured

Views

80

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Manage Attribute Expression selects too much

New Here ,
Jul 01, 2020

Copy link to clipboard

Copied

I am working in a structured file using FM19, version 15.0.6.956.

 

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?

  1. In the Conditional Tags pod, I added a conditional tag for shortdesc.
  2. I then went to the "Manage Attribute Experssions" and created a new expression: shortdesc
  3. leighb61493055_0-1593627314953.png
  4. I applied the shortdescr conditional tag
  5. leighb61493055_1-1593627459855.png

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.

 

Thanks.

 

 

TOPICS
PDF output, Publishing, Structured

Views

81

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 01, 2020 0
Adobe Community Professional ,
Jul 01, 2020

Copy link to clipboard

Copied

Try setting a value on the shortdesc element's outputclass attribute and change your expression to match that. See if it works then.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
New Here ,
Jul 01, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
Adobe Community Professional ,
Jul 01, 2020

Copy link to clipboard

Copied

I am not sure without seeing a document. You can send me one off list if you want: rick at frameexpert dot com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
Adobe Community Professional ,
Jul 01, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
New Here ,
Jul 01, 2020

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
Adobe Community Professional ,
Jul 01, 2020

Copy link to clipboard

Copied

You can do something like this: Edit > Find/Change, choose Element:

image.png

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 01, 2020 0
New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
Adobe Community Professional ,
Jul 02, 2020

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

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).

leighb61493055_0-1593700167574.png

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
Adobe Community Professional ,
Jul 02, 2020

Copy link to clipboard

Copied

Your expression doesn't look correct. I think it should be

NOT(class="- topic/shortdesc")

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

What you suggested is not working either. Any other thoughts?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
Adobe Community Professional ,
Jul 02, 2020

Copy link to clipboard

Copied

Open up the structure view with the attributes showing for your shortdesc element and post a screenshot. Thanks.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

Is this what you wanted?

leighb61493055_0-1593707703390.png

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
Adobe Community Professional ,
Jul 02, 2020

Copy link to clipboard

Copied

Yes, I wanted to make sure that your class attribute is explicity set. Let me try something here.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
Adobe Community Professional ,
Jul 02, 2020

Copy link to clipboard

Copied

I am not sure what the problem is. I am getting it to work here:

 

image.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
Adobe Community Professional ,
Jul 02, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

Thanks so much Rick! Looks adding that trailing space after the class attribute did the job! 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

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?

leighb61493055_0-1593719796347.png

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
Adobe Community Professional ,
Jul 02, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0
New Here ,
Jul 02, 2020

Copy link to clipboard

Copied

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.

leighb61493055_0-1593723536329.png

 

When I looked at the Build Expression window, you can see that the Attributes option window is blank.

leighb61493055_1-1593723629976.png

 

Thoughts?

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 02, 2020 0