Skip to content

Commit

Permalink
update search tag docs
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegDokuka committed Aug 4, 2015
1 parent 098b193 commit 8c14a60
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions docs/tag-engine/search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Search Tag
In this article:
- `Introduction`_
- `Use in template`_
- `Paging integration`_


Introduction
Expand All @@ -22,7 +23,9 @@ For using search in template all that needed are insert search-tag in the desire
.. code-block:: jsp
<imcms:search searchRequest="" skip="0" take="20">
<imcms:searchitem>
Some action with ${searchItem} here
</imcms:searchitem>
</imcms:search>
Expand All @@ -32,24 +35,13 @@ Available list of tag attributes:
+--------------------+--------------+--------------------------------------------------+
| Attribute | Type | Description |
+====================+==============+==================================================+
| no | Integer | Identifier for current image |
+--------------------+--------------+--------------------------------------------------+
| document | Integer | Identify the linked document (default |
| | | - current document) |
+--------------------+--------------+--------------------------------------------------+
| version | Integer | Identify version of image |
+--------------------+--------------+--------------------------------------------------+
| id | String | Html attribute ``id`` |
| searchRequest | String | Optional property. Set request is searching in |
+--------------------+--------------+--------------------------------------------------+
| pre | String | Text or html tag that would be added before |
| | | image tag |
| skip | Integer | Optional property. It is describing how many |
| | | items in result should be skipped |
+--------------------+--------------+--------------------------------------------------+
| post | String | Text or html tag that would be added after image |
| | | tag |
+--------------------+--------------+--------------------------------------------------+
| styleClass | String | Add html attribute ``class`` to image |
+--------------------+--------------+--------------------------------------------------+
| style | String | Add html attribute ``style`` to image |
| take | Integer | Optional property. It is describing how many |
| | | items in result should be taken |
+--------------------+--------------+--------------------------------------------------+

Example:
Expand All @@ -65,13 +57,31 @@ Example:
<meta charset="utf-8"/>
</head>
<body>
<imcms:image no="1" document="1001" pre="<div>" post="</div>"/>
<imcms:search searchRequest="" skip="0" take="20">
<ul class="simple-post-list">
<imcms:searchitem>
<li>
<div class="post-info">
<a href="${pageContext.request.contextPath}/${searchItem.foundDocument.alias}">${searchItem.foundDocument.headline}</a>
<div class="post-meta">
${searchItem.foundDocument.modifiedDatetime}
</div>
</div>
</li>
</imcms:searchitem>
</ul>
</imcms:search>
</body>
</html>
Paging integration
------------------

By default ``search`` tag provide paging. It is mean that ``pager`` tag can be inserted in to ``search`` tag body.
(see also :doc:`Pager Tag </tag-engine/pager>` section)



Expand Down

0 comments on commit 8c14a60

Please sign in to comment.