Custom Field Type: Special - Web Page View

From SmartWiki
Revision as of 12:50, 16 June 2008 by David (talk | contribs)

Jump to: navigation, search

Field Display

Field View

Cf19.png

Document Window – all Options enabled

Cf20.png

General Description

A Web Page View field is used to create a “document” based on underlying entity data. The field type has a wide variety of document management options associated including the conversion to PDF or XML.

Field Options

  • Allow Empty: N/A
  • Default Text: N/A
  • Options: HTML Template
  • Track Changes: N/A
  • Store To Value: N/A

Special Options for Field

  • Show Menu – check box that defines if a menu should be shown in the document window.
  • HTML Template – the body of the document combined with variables from the underlying entity.

General Options

  • Allow Printing – enables the user to print the resultant document.
  • Allow Editing – enables the userto edit the document with the HTML Editor
  • Allow New Window – displays the document in a new window so the browser’s print function can be used.
  • Is XML – indicates that the document is to be prepared as an XML output.

PDF Options

  • Enable Password Protection – enables the user to password protect the document (generally used when the document is going to be emailed).
  • Send as Email – enables the user to send the PDF as an attachment to an email message.
  • Save to Multiple File Field – enables the user to save the document as a PDF into any multiple file type fields in the related entity.
  • Save to Local Disk – enables the user to save a local copy of the PDF document.

HTML Options

  • Send as Email – enables the user to send the document as the body of an email message.
  • Save to Multiple File Field – enables the user to save the document as a HTML document into any multiple file type fields in the related entity.
  • Save to Local Disk – enables the user to save a local copy of the HTML document.

Field Validation

  • Type: N/A
  • JavaScript Validation: N/A
  • Message: N/A
  • HTML Tag: N/A

Field Formatting Options

  • Height: N/A Measure: Default: content window set to 800 * 600 Pixels.
  • Width: N/A Measure: Default: N/A
  • Number Format: N/A
  • Style: N/A
  • Tool Tip: N/A

Logic

Web Page View fields can use a unique SmartSimple logic interpreter. Web page logic gives you the ability to display certain content or perform certain actions only when specified conditions are met. SmartSimple logic follows the following template: <!--@sslogic(CONDITION)--> The content to be displayed when condition is true <!--@end-->

Condition is replaced with the logical condition that your case calls for. The following code sample will display a Christmas tree image if and only if it is currently December: <!--@sslogic(month(now())=12)--> <img src='images/xmasstree.jpg'> <!--@end-->

Note that the content to be displayed (the middle line) can either be in plaintext or in HTML.

Often, you will want to display one of two texts--one text in the case that a condition is met and another in the case that the condition is not met. This is achieved through the use of an "else" operator. The following sample code will display one message if a user is male and another if the user is female: <!--@sslogic('@sex@'='M')--> You are a guy. <!--@else--> You are a girl. <!--@end-->

Notes

This field type has extensive additional options that can be reviewed in the SmartSimple wiki – www.smartsimple.org