Templates parameter not properly displaying

Certified Senior Developer



I tried upload the template(Doc) many times after editing those not working fields plenty of times  but still the fields seems like above

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    This is a longstanding quirk with the DOCX from Template smart service, caused by unclean editing of the underlying template, in which word-markup XML accidentally gets inserted inside the text of the replacement keys.

    In general the best way to prevent this from happening is to make sure SPELL CHECK and GRAMMAR CHECK are COMPLETELY TURNED OFF in Word.  To fix a given entry, the simplest thing to try is deleting the replacement field, then manually re-typing it from scratch, making sure you type the whole thing in one go.

    The alternative method of fixing these, which works 100% of the time but is quite a bit harder to actually understand if you're unfamiliar with XML, is to edit the underlying XML file in the Docx ZIP file and make sure the "###replacementFieldName###" text blocks are all unbroken.  For this you can merely move text around - you don't need to edit any of the XML but you'd need to make sure whatever XML is there gets left in-place other than moving the plaintext around so it's all together.

    Important side-note: the smart service does not sanitize incoming text in any way when inserting text to fill the replacement fields.  That means characters that mean something else in XML (&, <, >, maybe a few others) need to be either removed or swapped with their XML/HTML equivalents ("&amp;", "&gt;", "&lt;", if i remember correctly).  It also means that if you really know what you're doing, you can inject your own XML to perform certain formatting operations - I actually figured out how to use this to construct entire tables, though that gets very complicated pretty quickly.

Reply
  • 0
    Certified Lead Developer

    This is a longstanding quirk with the DOCX from Template smart service, caused by unclean editing of the underlying template, in which word-markup XML accidentally gets inserted inside the text of the replacement keys.

    In general the best way to prevent this from happening is to make sure SPELL CHECK and GRAMMAR CHECK are COMPLETELY TURNED OFF in Word.  To fix a given entry, the simplest thing to try is deleting the replacement field, then manually re-typing it from scratch, making sure you type the whole thing in one go.

    The alternative method of fixing these, which works 100% of the time but is quite a bit harder to actually understand if you're unfamiliar with XML, is to edit the underlying XML file in the Docx ZIP file and make sure the "###replacementFieldName###" text blocks are all unbroken.  For this you can merely move text around - you don't need to edit any of the XML but you'd need to make sure whatever XML is there gets left in-place other than moving the plaintext around so it's all together.

    Important side-note: the smart service does not sanitize incoming text in any way when inserting text to fill the replacement fields.  That means characters that mean something else in XML (&, <, >, maybe a few others) need to be either removed or swapped with their XML/HTML equivalents ("&amp;", "&gt;", "&lt;", if i remember correctly).  It also means that if you really know what you're doing, you can inject your own XML to perform certain formatting operations - I actually figured out how to use this to construct entire tables, though that gets very complicated pretty quickly.

Children
No Data