2014-09-22 18 views
2

我想一個CSS定義一個CSS類添加到字段「myBookmark」(見下文)。有什麼建議麼? (打開頁面屬性時,會出現此選項卡。)如何CSS類添加到CQ對話框

<?xml version="1.0" encoding="UTF-8"?> 
<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" 
    jcr:primaryType="cq:Panel" 
    title="Interactions"> 
    <items jcr:primaryType="cq:WidgetCollection"> 
    <share 
    jcr:primaryType="cq:Widget" 
    title="Share" 
    xtype="dialogfieldset" 
    collapsed="{Boolean}false" 
    collapsible="{Boolean}true"> 
    <items jcr:primaryType="cq:WidgetCollection"> 
     <myBookmark jcr:primaryType="cq:Widget" type="select" xtype="selection" 
      defaultValue="" 
      fieldLabel="Share Button" 
      name="./share" > 
       <options jcr:primaryType="cq:WidgetCollection"> 
       <alignment1 jcr:primaryType="nt:unstructured" text="(inherit)" /> 
       <alignment2 jcr:primaryType="nt:unstructured" text="hide" value="hide"/> 
       <alignment3 jcr:primaryType="nt:unstructured" text="show" value="show"/> 
       </options> 
      </myBookmark> 
    </items> 
    </share> 
... 

現在,我與CQ工作:聽衆對話框內通過JS(http://dev.day.com/docs/en/cq/current/developing/components.html)添加CSS和使用添加CSS文件clientlibs(http://blogs.adobe.com/mtg/2011/11/building-components-in-adobe-cq-5-part-1-a-tutorial-on-clientlibs-using-jquery-ui.html

這些替代品並不符合我的需求。

本尼迪克特

回答

0

爲ExtJS的插件的類可以通過addded開箱配置屬性的:cls。請參閱CQ5 Widgets API documentation

<items jcr:primaryType="cq:WidgetCollection"> 
    <myBookmark 
     jcr:primaryType="cq:Widget" 
     cls="myClassName" 
     defaultValue="" 
     fieldLabel="Share Button" 
     name="./share" 
     type="select" 
     xtype="selection"> 
      <options jcr:primaryType="cq:WidgetCollection"> 

實際的CSS規則應該像您在客戶端庫中提到的那樣放置。你只需要確保clientlib被連接到你打開對話框的頁面。您可以綁定到wcm.edit(這是用來通過CQ到diplay對話框),或者你可以創建自己的類別(如css.test),然後包括你自己的clientlib:<cq:includeClientLib css="css.test" />