Does <#include> work with file paths? The f...
# advancedpdf
j
Does <#include> work with file paths? The freemarker manual suggests file paths, but I found a SuiteAnswers article that says you need to use file cabinet internal ids.
n
yes. If you want to use the file cabinet use the internal id.
or you can make the file link available without login... code security risk tho
j
and I guess the second option that would use the file URL?
w
Aha! What was the suiteanswer number? I didn't find anything but maybe I was using the wrong keywords
I've been trying to do it by file cabinet path
j
SuiteAnswers 68965
m
For security, I always use the ID if it’s in the File Cabinet. <#include β€œ1234”>
j
thanks
n
Inserting Subtemplates into Templates You can use the include directive to insert another template inside of your template. This is often used when you have a template that presents information you want to reuse many times. For example, you might create a template that is used as a header for all communication you send out. This might include your company logo and contact information. The include directive can reference template files by URL or file cabinet ID. For example, to insert a template in the NetSuite file cabinet with the internal ID of 123, you could use: <#include "123"> Note The number must be a file ID, not a template ID. To insert a template by referencing the URL, you could use: <#include "http://company.com/templates/myheader.ftl"> Important If you include templates from outside of NetSuite, your email may not be generated properly if there is a problem with the URL or the hosting website. Additionally, if the hosting website does not respond to the request for the template within five seconds, the email message is generated without that template. If the hosting website is an SSL site, it must have a trusted SSL certificate. Templates that you insert with include directives cannot themselves contain include directives.
Answer Id: 32621
The only thing that sucks using the file cabinet internal id is moving the code between environments. You'll need to update the internal id's when you move it
w
Thanks for all the help, I got it working.
πŸ‘ 1
n
I spent a long time trying to figure this out and it sucked my life haha