Dashlet with FAQ search

Moderator: crythias

Post Reply
ahfnr
Znuny newbie
Posts: 2
Joined: 07 Aug 2017, 10:46
Znuny Version: 5.0.20
Real Name: Andreas

Dashlet with FAQ search

Post by ahfnr »

Hi all,

I'm trying to configure a dashboard widget showing FAQs that haven't been changed for more than 2 years. I have already found a template in the Kernel/Config/Files/FAQ.xml-File:

Code: Select all

    <ConfigItem Name="DashboardBackend###0398-FAQ-LastChange" Required="0" Valid="1">
        <Description Translatable="1">Defines the parameters for the dashboard backend. "Limit" defines the number of entries displayed by default. "Group" is used to restrict access to the plugin (e. g. Group: admin;group1;group2;). "Default" indicates if the plugin is enabled by default or if the user needs to enable it manually.</Description>
        <Group>FAQ</Group>
        <SubGroup>Frontend::Agent::Dashboard</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::Dashboard::FAQ</Item>
                <Item Translatable="1" Key="Title">Latest updated FAQ articles</Item>
                <Item Key="Description"></Item>
                <Item Key="Type">LastChange</Item>
                <Item Key="Block">ContentSmall</Item>
                <Item Key="Group">faq</Item>
                <Item Key="Default">1</Item>
            </Hash>
        </Setting>
    </ConfigItem>
I don't have a clue where to put the search. It looks like it must be somewhere in the "type"-item, but I've only found the values "LastChange" and "LastCreate". Is that hard-coded or is there a way to make it work with some sort of custom search expression?

Any help greatly appreciated!

Thanks
Andi
ahfnr
Znuny newbie
Posts: 2
Joined: 07 Aug 2017, 10:46
Znuny Version: 5.0.20
Real Name: Andreas

Re: Dashlet with FAQ search

Post by ahfnr »

I've had a look at the source code recently:

Code: Select all

    # check type
    if ( $Param{Type} !~ m{ LastCreate | LastChange }xms ) {
        $Kernel::OM->Get('Kernel::System::Log')->Log(
            Priority => 'error',
            Message  => 'Type must be either LastCreate or LastChange!',
        );
        return;
    }
(in Kernel/Output/HTML/Layout/FAQ.pm)

Looks like this is hardcoded with no way to change it out of the box.

Thank you guys anyway!
Post Reply