Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do I hide an element (draft-comment) in the PDF output

New Here ,
Dec 06, 2021 Dec 06, 2021

I'm using FrameMaker 2020 (v16.0.2) just long enough to build output templates for the FMPS and AEM XML. I need to be able to hide all <draft-comments> in the PDF output (and eventually all outputs). In our current system, these were automatically hidden in outputs so we've made extensive use of them as notes between authors that are not deleted.

 

I can see that <data> or <data-about> may have been the better choice for this sort of thing, but that ship has sailed. 🙂 Is there any way to hide draft-comments in all outputs? I'm assuming that's handled somewhere in the EDD.FM file. I found where the draft-comments are defined, but I'm not seeing any place obvious to set the output to "hide". Is it in the outputclass setting?

1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 06, 2021 Dec 06, 2021

Hi,

 

I am not an expert for structured FrameMaker.

However, what I learned is that you should use attributes to filter what is shown or hidden:

https://help.adobe.com/en_US/framemaker/using/using-framemaker/user-guide/topic_create-filters.html

 

It could be that you can use XSLT to change your elements.

 

Best regards

 

Winfried

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 07, 2021 Dec 07, 2021

You can use FrameMaker's Filter by Attribute functionality. Open the EDD to find the exact string for class attribute of the draft-comment element. Copy that value, then go back to your DITA document and select View > Filter by Attribute. Add a new expression, select the class attribute and the Equal option, then paste the value. Make sure the expression has NOT before the attribute expression. Select Show All to have the draft comments shown, Show as per Expression to have the draft comments hidden. Producing PDF should work for the currently visible content. I have not tested that but if the hidden content does show up in your PDF that is a bug and should be addressed to the dev team.
Screenshot 2021-12-07 at 17.22.08.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 07, 2021 Dec 07, 2021

The name of the expression in the dialog box relates to my first trial to use the outputclass attribute, but that would require you to set that attribute on all existing content, which would be a hassle. So I tried with the class attribute and then forgot to rename the expression. It still works of course but it might be better to choose HideDraftComments or something similar.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 09, 2021 Dec 09, 2021

Do let us know if this worked for you. Marking something as a correct answer makes it show up immediately below the original posted question and helps others to quickly find the solution.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 09, 2021 Dec 09, 2021

I'm sorry, I haven't had a chance to test this. We're in the middle of upgrading AEM XML's add-on version and the FMPS version to match and work with the UUID release of XML Add-on so I cannot test any FMPS outputs. I can only test the output templates on my computer using structured Frame. I'll try to give this a try soon.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2021 Dec 13, 2021

Yes and no.

Yes, this process hid the draft-comment in both the view of the topic and in the output, but this procedure doesn't appear to be anything that can be applied at the output template level.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 14, 2021 Dec 14, 2021

It just means that you work with the Show All option, so you can see all the draft comments, then as part of the publishing process you select Hide Draft Comments. You can also have a simple script apply the filter before publishing. That can be made to run automatically when the Publish event fires. But it should not be such a problem to perform 2 simple actions instead of 1 when publishing the content...

 

Of course you can also start tampering with the output process but that would be much more work (as it would have to be done for each output format).

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 14, 2021 Dec 14, 2021

Yes, I would think it would have to be done within the output templates for each output, just like it is done for DITA-OT templates.

 

I'll have to wait to test the FMPS outputs until after IT gets the XML Editor and FMPS versions aligned.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 14, 2021 Dec 14, 2021

As you are using FMPS you could use the built-in capabilies of FM to remove any draft-comment from the files before they are published. There is no need to make that change in all templates. Just have a very simple XSL that removes the draft-comment before the file is opened in FMPS for publishing. The structured application that handles the XML file allows adding such an XSL to be executed just before loading the XML into FM. These changes are not saved back to the XML file, as FMPS will not perform a save on files to be published.

 

The XSL is a very straightforward identity transform with one extra template removing the draft-comment.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 15, 2021 Dec 15, 2021

Be careful, when you just delete text with a condition or an attribute.

When the text is a paragraph at the end of a text flow (e.g. in a table cell or in the table title), then you might end up with an empty paragraph which you do not want to have.

Just take this into account.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 15, 2021 Dec 15, 2021

If the content to be deleted is inside a <draft-comment> the remaining content after filtering remains valid DITA. So there should be no danger of running into the problems you indicate. It is a different matter when using filters that remove a table cell from the structure, of course. Using FM Conditional Tags is less reliable in this respect.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 15, 2021 Dec 15, 2021
LATEST

Yes, this is likely what I'll have to do. However, I'm going to have to wait until the AEM server and FMPS is back online to test to see if the existing XSL already does this or not. In the mean time, I can probably try to locate the similar files on the Structured Frame installation on my computer and see if I can make the change there.

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