How to transfer changed content into plone theme with diazo?

204 views Asked by At

Now I need the following search structure in the theme:

<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>

All I need to get from Plones sunburst theme is the action link for the form element. So I tried this:

<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" />

The problem ist that all I get in the theme is the structure of 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ā€¦</a>
        </div>
    </aside>
</div>

I'm familiar with diazo but pretty new to xslt. What is wrong? I tired several types of placements like import before it gets modified. Nothing helps.

1

There are 1 answers

1
ebrehault On

Using the replace directive on attribute itself should work:

<replace attributes="action"
    css:content="#portal-searchbox form"
    css:theme="#searchform" />