Difference between revisions of "Attach a PDF to a Web Page View"

From SmartWiki
Jump to: navigation, search
Line 1: Line 1:
 
You can use the '''ssattach''' function to append one or more PDF documents stored in either a [[Custom Field Type: Link – Single File|Single File Field]] or [[Smart Folder]] to a [[Web Page View Field]].  
 
You can use the '''ssattach''' function to append one or more PDF documents stored in either a [[Custom Field Type: Link – Single File|Single File Field]] or [[Smart Folder]] to a [[Web Page View Field]].  
  
The attached PDF file(s) will not be visible when viewing the web page in HTML mode, but will be appended when exported as a PDF, saved as a PDF, emailed as PDF or created by a [[Workflow]] as attachment.
 
  
 +
'''Note:''' The attached PDF file(s) will '''not''' be visible when viewing the web page in HTML mode, but will be appended when exported as a PDF, saved as a PDF, emailed as PDF or created by a [[Workflow]] as attachment.
  
'''Sample Codes'''
+
==Syntax==
 +
To display a list of the contacts assigned at Level 2:
 +
:<font size="3">'''[#(?object=contact;) ~firstname~ ~lastname~ ~email~ #]'''</font>
 +
 
 +
 
 +
 
 +
==Examples==
 
* Append a PDF file from a [[Smart Folder]] '''before''' the current [[Web Page View Field]] page:
 
* Append a PDF file from a [[Smart Folder]] '''before''' the current [[Web Page View Field]] page:
 
<pre>
 
<pre>
Line 37: Line 43:
  
  
'''Rules'''
+
==Additional Information==
  
 
* The '''ssattach''' function can be placed anywhere inside the [[Web Page View Field]]
 
* The '''ssattach''' function can be placed anywhere inside the [[Web Page View Field]]
* Multiple files can be attached from different sources:
+
* All PDF page settings will driven by the first PDF document file, whether it is a static file or one generated by [[SmartSimple]]
 +
* Multiple PDF files can be attached from different sources by using multiple ssattach statements:
 
<pre>
 
<pre>
 
 
<!--@ssattach(before;/files/1234/123/myfileheader.pdf )-->
 
<!--@ssattach(before;/files/1234/123/myfileheader.pdf )-->
 
<!--@ssattach(after;/files/1234/123/myfilefooter.pdf )-->
 
<!--@ssattach(after;/files/1234/123/myfilefooter.pdf )-->
Line 52: Line 58:
 
</pre>
 
</pre>
  
* All page settings will driven by first PDF document file, either it is a static file or generated by [[SmartSimple]]
+
* [[SSlogic]] can be used if the PDF file(s) to be attached needs to be varied using conditional statments:
 
 
 
 
'''SSlogic'''
 
 
 
* Using @customfield@ instead of [[Smart Folder|smart folder]] file (like @parent.contract@)
 
* Use if sslogic like this:
 
 
 
 
<pre>
 
<pre>
 
<!--@sslogic('@type@'='contact')-->
 
<!--@sslogic('@type@'='contact')-->
 
       <!--@ssattach(after;@parent.contract.value@)-->
 
       <!--@ssattach(after;@parent.contract.value@)-->
 
 
<!--@else-->
 
<!--@else-->
 
     <!--@ssattach(after;@parent.othercontract.value@)-->
 
     <!--@ssattach(after;@parent.othercontract.value@)-->
Line 69: Line 67:
  
 
</pre>
 
</pre>
 +
 +
 +
==See Also==
 +
* [[Web Page View]]
 +
* [[sslogic]]
 +
  
 
[[Category:Custom Fields]][[Category:PDF]]
 
[[Category:Custom Fields]][[Category:PDF]]

Revision as of 14:46, 17 May 2010

You can use the ssattach function to append one or more PDF documents stored in either a Single File Field or Smart Folder to a Web Page View Field.


Note: The attached PDF file(s) will not be visible when viewing the web page in HTML mode, but will be appended when exported as a PDF, saved as a PDF, emailed as PDF or created by a Workflow as attachment.

Syntax

To display a list of the contacts assigned at Level 2:

[#(?object=contact;) ~firstname~ ~lastname~ ~email~ #]


Examples

<!--@ssattach(before;/files/1234/123/myfile.pdf )-->


<!--@ssattach(after;/files/1234/123/myfile.pdf )-->


<!--@ssattach(before;@AttachPDFFile.value@)--> 
  • Note: Don't forget to include .value


[#(?object=contact;)<!--@ssattach(after;$?opr_123456.value$)-->#]

Where 123456 is the Custom Field ID


  • You can also control the format settings of the PDF that is output by using the following syntax. The PDF file referenced should be a blank one-page pdf file which has the format settings you wish your PDF document to have. The Web Page View will be inserted onto this template:
<!--@ssattach(setting;/files/1234/123/myfile.pdf)--> 


Additional Information

  • The ssattach function can be placed anywhere inside the Web Page View Field
  • All PDF page settings will driven by the first PDF document file, whether it is a static file or one generated by SmartSimple
  • Multiple PDF files can be attached from different sources by using multiple ssattach statements:
<!--@ssattach(before;/files/1234/123/myfileheader.pdf )-->
<!--@ssattach(after;/files/1234/123/myfilefooter.pdf )-->
<!--@ssattach(after;/files/1234/123/myfileappendix.pdf )-->
<html><body>
  My Pdf file
</body></html>

  • SSlogic can be used if the PDF file(s) to be attached needs to be varied using conditional statments:
<!--@sslogic('@type@'='contact')-->
       <!--@ssattach(after;@parent.contract.value@)-->
<!--@else-->
     <!--@ssattach(after;@parent.othercontract.value@)-->
<!--@end-->


See Also