contribution

Description: A document contribution. A JavaScript file/scriplet, a CSS file or classes or a MetaTag.

JavaDoc: Click here

Body content: JSP. Will be used as the contribution source when no fileURL is given.

Attributes:

Name Description Data type Required Default value
id A unique identifier for this contribution. If more additions happen with the same ID they will be ignored String No -
type The type of the contribution. See bellow String No CSS_FILE
scope The scope of the script (for JS contributions only). See bellow. String No HEAD
fileURL The URL for the file to link. String No -

Contribution Types:

  • CSS_ENTRY: A simple CSS class definition, defined in the body of this Tag
  • CSS_FILE: A CSS file.
  • JS_SCRIPTLET: A JavaScript scriptlet.
  • JS_FILE: A JavaScript file.
  • META_TAG: An HTML Meta tag to include in the HEAD section

Scriplet Scopes:

  • HEAD: Include the contribution on the document HEAD section
  • ON_LOAD: Include the contribution in the page onLoad initializer (for JavaScript contributions only)
  • PAGE_END: Include the contribution at the page end, before the onLoad section (for JavaScript contributions only)

Examples:

<dif:document>
        <dif:contribution id="css:someCSSFileUniqueID" type="css_file" fileURL="css/main.css" />
        <dif:contribution id="css:someJSFileUniqueID" type="js_file" fileURL="js/effects.js" />
        
        <dif:contribution id="keywords" type="meta_tag">
                name="keywords" content="dif, digitalis, framework, java"
        </dif:contribution>
        
        <dif:contribution type="css_entry">
                .bold{font-weight: bold;}
                .normal{font-weight: normal;}
                .floatLeft{float: left;}
                .floatRight{float: right;}
                .alignLeft{text-align: left !important;}
                .alignRight{text-align: right !important;}
                .alignCenter{text-align: center;}
                .borderNone{border: none;}
        </dif:contribution>

        <dif:contribution type="hs_scriptlet">
            var logincontentState = true;
            function tooglelogincontentFunc(){
              if (logincontentState) {
                Ext.get('logincontent').slideOut('t');
              } else {
                Ext.get('logincontent').slideIn();
              }
              logincontentState = !logincontentState;
            }
        </dif:contribution>
    ...
</dif:document>

See also:

Back to tag reference