1

现在我需要主题中的以下搜索结构:

<div class="sideCol">
    <aside class="siteSearch">
        <form name="searchform" action="search" class="searchPage searchform" id="searchform">
            <fieldset>
                <legend>Website durchsuchen</legend>
                <input class="searchPage text lang-de" name="SearchableText" type="text" size="25" title="Website durchsuchen" value="" placeholder="Suchbegriff..." />
                <button type="submit"><i class="icon-search"></i></button>
            </fieldset>
        </form> 
    </aside>            
</div>

我需要从 Plones sunburst 主题中获得的只是表单元素的操作链接。所以我尝试了这个:

<replace css:content-children="#portal-searchbox">
    <xsl:variable name="action_link" select="form/@action" />
    <form name="searchform" action="search" class="searchPage searchform" id="searchform">
        <xsl:attribute name="action">${action_link}</xsl:attribute>
        <fieldset>
            <legend>Website durchsuchen</legend>
            <input class="searchPage text lang-de" name="SearchableText" type="text" size="25" title="Website durchsuchen" value="" placeholder="Suchbegriff..." />
            <button type="submit"><i class="icon-search"></i></button>
        </fieldset>
    </form>
</replace>
<replace css:content-children="#portal-searchbox" css:theme-children=".siteSearch" />

问题在于我在主题中得到的只是 Plones Sunburst Search 的结构。

<div class="sideCol">
    <aside class="siteSearch">
        <form id="livesearch0" action="http://localhost:8080/mamuz/de/@@search">
            <div class="LSBox">
                <label class="hiddenStructure" for="searchGadget">Website durchsuchen</label>
                <input name="SearchableText" type="text" size="18" title="Website durchsuchen" placeholder="Website durchsuchen" accesskey="4" class="searchField" id="searchGadget" autocomplete="off">
                <input class="searchButton" type="submit" value="Suche">
                <div class="searchSection">
                    <input id="searchbox_currentfolder_only" class="noborder" type="checkbox" name="path" value="/mamuz/de/impressum">
                    <label for="searchbox_currentfolder_only" style="cursor: pointer">nur im aktuellen Bereich</label>
                </div>
                <div class="LSResult" id="LSResult">
                    <div class="LSShadow" id="LSShadow"></div>
                </div>
            </div>
        </form>
        <div id="portal-advanced-search" class="hiddenStructure">
            <a href="http://localhost:8080/mamuz/de/@@search" accesskey="5">Erweiterte Suche…&lt;/a>
        </div>
    </aside>
</div>

我对重氮很熟悉,但对 xslt 却很陌生。怎么了?在修改之前,我厌倦了几种类型的展示位置,例如导入。没有什么帮助。

4

1 回答 1

0

在属性本身上使用 replace 指令应该可以工作:

<replace attributes="action"
    css:content="#portal-searchbox form"
    css:theme="#searchform" />
于 2013-12-05T12:39:56.683 回答