You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ol...@apache.org on 2015/04/19 21:15:16 UTC

svn commit: r1674675 - /sling/site/trunk/content/documentation/bundles/scripting/scripting-thymeleaf.mdtext

Author: olli
Date: Sun Apr 19 19:15:16 2015
New Revision: 1674675

URL: http://svn.apache.org/r1674675
Log:
add paragraph for Sling Dialect

Modified:
    sling/site/trunk/content/documentation/bundles/scripting/scripting-thymeleaf.mdtext

Modified: sling/site/trunk/content/documentation/bundles/scripting/scripting-thymeleaf.mdtext
URL: http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/scripting/scripting-thymeleaf.mdtext?rev=1674675&r1=1674674&r2=1674675&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/scripting/scripting-thymeleaf.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/scripting/scripting-thymeleaf.mdtext Sun Apr 19 19:15:16 2015
@@ -4,21 +4,19 @@ Sling Scripting Thymeleaf is the scripti
 
 [TOC]
 
-Features
---------
+# Features
 
 * out of the box support for _legacy_ HTML5 through embedded _NekoHTML_
 * runtime configurable `TemplateModeHandler`s for _XML_, _VALIDXML_, _XHTML_, _VALIDXHTML_, _HTML5_ and _LEGACYHTML5_
 * `ResourceResolver` backed by Sling's `ResourceResolver`
 * `MessageResolver` backed by `ResourceBundleProvider` from `org.apache.sling.i18n`
+* `SlingDialect`
 
-Class Diagram
--------------
+# Class Diagram
 
 [![Class Diagram](class-diagram.svg)](class-diagram.svg)
 
-Installation
-------------
+# Installation
 
 For running Sling Scripting Thymeleaf with Sling's Launchpad some dependencies need to be resolved. This can be achieved by installing the following bundles:
 
@@ -33,8 +31,7 @@ There is a feature for Karaf:
     karaf@root()> feature:repo-add mvn:org.apache.sling/org.apache.sling.launchpad.karaf-features/0.1.1-SNAPSHOT/xml/features
     karaf@root()> feature:install sling-scripting-thymeleaf
 
-Configuration
--------------
+# Configuration
 
 By default Sling Scripting Thymeleaf's _Script Engine Factory_ is configured for templates with extension `html` and mime type `text/html`.
 
@@ -48,8 +45,23 @@ The _HTML5 Template Mode Handler_ is con
 
 ![Sling Scripting Thymeleaf HTML5 Template Mode Handler](scripting-thymeleaf-html5-template-mode-handler.png)
 
-Sample
-------
+# Sling Dialect
+
+Sling Scripting Thymeleaf comes with its own dialect using the `sling` prefix/namespace currently supporting the _include_ feature known from [Sling Scripting JSP Taglib]({{ refs.sling-scripting-jsp-taglib.path }}).
+
+## include
+
+The resource object or the path to the resource object to include in the current request processing. If this path is relative it is appended to the path of the current resource whose script is including the given resource.
+
+* `data-sling-include` in HTML5, `sling:include` in XHTML (`Resource` or `String`)
+* supported options (* = [RequestDispatcher option](http://sling.apache.org/apidocs/sling7/org/apache/sling/api/request/RequestDispatcherOptions.html)):
+  * `addSelectors` (`String`) *: When dispatching, add the value provided by this option to the selectors.
+  * `replaceSelectors` (`String`) *: When dispatching, replace selectors by the value provided by this option.
+  * `replaceSuffix` (`String`) *: When dispatching, replace the suffix by the value provided by this option.
+  * `resourceType` (`String`) *: The resource type of a resource to include. If the resource to be included is specified with the path attribute, which cannot be resolved to a resource, the tag may create a synthetic resource object out of the path and this resource type. If the resource type is set the path must be the exact path to a resource object. That is, adding parameters, selectors and extensions to the path is not supported if the resource type is set.
+  * `unwrap` (`Boolean`): removes the host element
+
+# Sample
 
 The [Sling Fling Sample](http://svn.apache.org/repos/asf/sling/trunk/samples/fling/) is a sample using Sling Scripting Thymeleaf with [Sling Models]({{ refs.models.path }}) and [Sling Query]({{ refs.sling-query.path }}).