[opencms-dev] cms:search configuration

Klapf Hanspeter Hanspeter.Klapf at ikt.linz.at
Wed Mar 15 08:32:08 CET 2023


It might not be the best solution, but it’s working for me:

I’m now using field additional request parameter in the search configuration file with the name “parent-folders” and solr-query “fq=parent-folders:(%(value))”.

With this configuration and the additional jsp code, I can filter on folder-selection:

<c:set var="rootfolder" value="/sites/intra-test/" />
<c:set var="folders">
            /sites/intra-test/organisation/,
            /sites/intra-test/personal/,
            /sites/intra-test/richtlinien/,
            /sites/intra-test/sicherheit/,
            /sites/intra-test/service-zone/,
</c:set>
<div class="panel panel-default m-box">
            <div class="panel-heading h6"><strong>Bereich</strong></div>
            <div class="panel-body">
                        <c:set var="sel">${fn:replace(param["parent-folders"], "\"", "")}</c:set>
                        <c:forTokens items="${folders}" delims="," var="folder">
                                    <div class="checkbox">
                                               <label>
                                                           <c:set var="f"><c:out value="${fn:trim(folder)}" escapeXml="true" /></c:set>
                                                           <c:set var="fq">"<c:out value="${f}" escapeXml="true" />"</c:set>
                                                           <input type="radio"
                                                                                      name="parent-folders"
                                                                                      value="${fq}"
                                                                                      onclick="submitSearchForm()"
                                                                                      ${f eq sel ? "checked" : ""} />
                                                           ${cms:vfs(pageContext).property[f]['Title']}
                                               </label>
                                    </div>
                        </c:forTokens>
                        <div class="checkbox">
                                    <label>
                                               <c:set var="f"><c:out value="${fn:trim(rootfolder)}" escapeXml="true" ></c:out></c:set>
                                               <input type="radio" name="parent-folders" value=""${f}"" onclick="submitSearchForm()" ${f eq sel ? "checked" : ""} /> -- ALLE --
                                    </label>
                        </div>
            </div>
</div>

Best regards!


Von: opencms-dev <opencms-dev-bounces at opencms.org> Im Auftrag von Klapf Hanspeter via opencms-dev
Gesendet: Dienstag, 14. März 2023 12:06
An: The OpenCms mailing list <opencms-dev at opencms.org>
Cc: Klapf Hanspeter <Hanspeter.Klapf at ikt.linz.at>
Betreff: [UGL-extern] [opencms-dev] cms:search configuration

Hello!

I am using the JspSearchConfig in OC11 with the Formatter copied from the example in the OC11 Documentation (cannot find it in actual version), only slightly modified.

What would be the best option to supply an extra filter-option for 5-6 extra defined folder-locations? I have some main-folders my site /sites/intranet which I would like to be selectable for the users to filter their search result. I have tried adding distinct categories to these folders, but the contents aren’t found, when the category is selected (maybe because these categories map to the container pages, not the contents?).

Perhaps I could switch from configFile to configString and manually set the Solr-param “fq” with parent-folders:”/sites/intranet/mycontentfolder1\” for example, would this be the best approach?

Thanks for any advice!

Best regards




________________________________

Diese Nachricht inklusive aller Anhänge kann vertrauliche Informationen enthalten. Sie ist ausschließlich für die adressierten Personen bestimmt. Das unerlaubte Kopieren sowie die unbefugte Weitergabe sind nicht gestattet. Sollten Sie nicht die richtige Adressatin/der richtige Adressat sein, vernichten Sie den gesamten Inhalt (§ 93 Abs. 4 Telekommunikationsgesetz 2003) und informieren Sie bitte sofort den/die Absender/in. Nähere Regelungen zur elektronischen Kommunikation mit der Stadt Linz finden Sie in den "Allgemeinen Hinweisen und Nutzungsbestimmungen betreffend das E-Government der Stadt Linz (e-linz)" ( http://www.linz.at/images/AGB_egov_Stadt_Linz.pdf).
Informationen über die Verarbeitung personenbezogener Daten finden Sie unter https://www.linz.at/images/files/Datenschutzerklaerung_IKT.pdf

IKT Linz GmbH, Firmenbuch des Landesgerichtes Linz ++ Firmenbuch-Nummer: 321197z ++ UID-Nummer: ATU64636344
A-4020 Linz, Peter-Behrens-Platz 4, Tel. +43 732 7070 0, Fax: +43 732 7070 4704, office at ikt.linz.at, www.linz.at/ikt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencms.org/pipermail/opencms-dev/attachments/20230315/1983daf0/attachment.htm>


More information about the opencms-dev mailing list