A標簽用于生成html的超鏈接標簽a,如
~~~
<a href="http://www.mysite.com">我的超鏈接</a>
~~~
在文檔管理中可以給文檔標題加上顏色、粗體、斜體、是否新窗口打開等屬性,要在html頁面中顯示這些效果,需要在模版較多的判斷,使用A標簽可以自動處理這些屬性。
標題的粗體和斜體通過給class加上strong、em,如class="strong em",需要配合相應的css才能顯示效果。
**實現類**
* com.jspxcms.common.freemarker.AnchorDirective
**參數**
* bean:實體對象,如info、node。
* target:html的a標簽的target屬性。字符串。如:_blank。
* length:標題長度。整型。標題超過指定長度會被截斷,兩個英文字母占一個長度。
* append:超過長度后的代替字符。字符串。通常使用...。
* class:html的a標簽的class屬性。字符串。
* style:html的a標簽的style屬性。字符串。
* attrs:html的a標簽的其他屬性。字符串。如:myattr=abc。
* isStyle:是否處理顏色、粗體和斜體。布爾型。默認:true。
**范例**
~~~
[A bean=info length='15' append='...'/]
[A bean=node length='20' append='…' target='_blank'/]
~~~
- 標簽基本知識
- InfoList與InfoPage標簽
- NodeList標簽
- NodeList與NodePage標簽
- InfoFulltextList與InfoFulltextPage標簽
- SpecialCategoryList標簽
- SpecialList與SpecialPage標簽
- TagList與TagPage標簽
- CommentList與CommentPage標簽
- FriendlinkTypeList標簽
- GuestbookTypeList標簽
- GuestbookList和GuestbookPage標簽
- Node標簽
- Info標簽
- InfoPrev標簽
- InfoNext標簽
- Vote標簽
- 標簽通用參數
- A標簽
- QuestionList與QuestionPage標簽
- Question標簽
- Query標簽