Changes

Web Page View Field

22 bytes removed, 21:01, 22 August 2018
no edit summary
==Overview==
 
The '''Web Page View''' field provides the ability to display a fully formatted document or web page.
Web page view fields are very useful for creating:
 
* Correspondence such as letters.
* Contracts and Agreements.
* Forms.
 
You control the following attributes for each '''Web Page View''' field that you add to the system:
 
* The format used for the saved document – either '''[[:Category:PDF|PDF]]''' or '''HTML''' format.
For types on format conversion compatibility between '''[[:Category:PDF|PDF]]''' and '''HTML''' go to:
'''http://pd4ml.com/css.htm'''
 
* Where the document can be saved either back to a [[SmartSimple]] file field or to the local computer.
* If the document can be edited to make final changes.
* If the document can be emailed (in either [[:Category:PDF|PDF]] or HTML format).
* If the document requires a [[Password|password]] ([[:Category:PDF|PDF]] only).
In constructing this type of field you add:
 
* HTML tags that control the formatting of the page.
* Static text that does not change.
In order to create these types of fields you will need to have some familiarity with HTML formatting tags as well as the names of the values you wish to place in the final document.
* JavaScript to provide advanced features (see [[:Category:JavaScript]])
<!--
==What is HTML?==
 HTML (Hyper Text Markup Language) is the formatting language for web pages and for the '''Web Page View''' field within [[SmartSimple]]. There are lots of good sources you can use to become familiar with HTML on the Internet.
==What are SmartSimple Variables?==
 
Variables are placeholders that you add to the [[Template|template]] that display a value from the [[SmartSimple]] database.
For example, if you were to add the variable name '''@me.firstname@''' to the [[Template|template]] your name would replace the variable name when the document is viewed.
Variable names always take the same format - '''@variable@'''. A complete list of variables can be found in [[Web Page View Field Variables|this]] article.-->
<u>'''Before You Start'''</u>
There are a number of techniques that you can use to create the content of the document.
 * Edit the HTML template within [[SmartSimple]] - using this approach , you need to know at very least some HTML code , as you will be adding these formatting codes directly to the document. It may be ok for simple documents, but too difficult an approach for more complicated documents.* Create the HTML [[Template|template]] using another application – using this approach you create the HTML code in one of a number of recommended HTML editors and then when complete copy and paste the code into the HTML content field. This technique is recommended for more complex documents. The recommended tools are listed below.
==Recommended HTML Editors==
 
[[Image:Wpv.png]]
<u>'''Not Recommended Editors'''</u>
'''Microsoft Word''' and '''Microsoft FrontPage''' are not recommended as editors , as they both add proprietary formatting tags that will cause problems when displaying the contents of your web page view field in [[Browser|browsers]] other than Internet Explorer (Microsoft’s own browser)
==Creating or Editing the Field==
 The following example shows the creation of a simple employee Letter of Offer , displaying the new employee’s name and address , plus details of their compensation.
This is how the field will look before you add the HTML template:
[[Image:Wpv1.png]]
The '''HTML Template''' is used to store the body of the document and will be a mix of HTML code, static text and variable names – in this case the variables will reference the [[User|user]] [[Entity|entity]] and the employee [[Role|role]].
==Basic HTML Tags Required==
 
[[Image:Wpv2.png]]
==Sample Template with HTML Tags, Static Text and Variables==
 
[[Image:Wpv3.png]]
The following code is used to control the margins in the document. There are two methods of setting the document margins – you can set margins within the body tab of the HTML OR define styles in the head portion of the HTML.
The above settings will work in both Firefox and Internet Explorer.
<pre>...
<script language="javascript">// <![CDATA[
parent.pdfwrite();
// ]]></script>
</pre>
==Adding a Logo or Image to the Web page View Field==
 If you wish to add an image to a document such as your company logo then the easiest method is to add a [[Custom Field|custom field]] to your company setting and then reference this field in the '''HTML Template'''. For example, a [[Custom Field|custom field]] named Logo as Display Only - Image type field. You can then reference this image as '''@branch.logo@''' in the HTML template.
'''Note:''' When adding an image from a SmartFolder, and converting the document to PDF, the image link must be an absolute reference (with http://xxx.smartsimple.xxx/files/123/f1235/image.jpg) instead of a relative one (/files/123/f1235/image.jpg).
==Displaying a Web Page View Field==
 
The Web Page View field is displayed as a button.
[[Image:Wpv7.png]]
When you click the button the document is completed and displayed.
[[Image:Wpv8.png]]
* All variables are added, except the salutation field because it is not set in the underlying [[Entity|entity]].
* There are no options available for this document – these must be enabled.
A special tag is used to suppress any fields that are missing from the underlying [[Entity|entity]]:
 <pre> <!--hideifnotfound-->@my variable@
</pre>
Placing this tag '''immediately''' in front of any field that may not be present will suppress the display of the variable name. ('''Note: there must not be a space between the tag and the variable''')
==Document Options==
 
You control which options are available to the [[User|user]] of each '''Web Page View''' field.
[[Image:Wpv9.png]]
* '''Show Menu''' – check box that defines if a [[Menu|menu]] should be shown in the document window.
* '''Save to Multiple File Field''' – enables the [[User|user]] to save the document as a [[:Category:PDF|PDF]] into any multiple file type fields in the related [[Entity|entity]].
* '''Save to Local Disk''' – enables the [[User|user]] to save a local copy of the [[:Category:PDF|PDF]] document.
 
Smartstaff, administrator
421
edits