Developer forum

Forum » CMS - Standard features » Implement Search (weighted)

Implement Search (weighted)

Martin Grønbekk Moen
Reply

Im trying to add search to my site without any luck.

 

Created a new page called "Search".

 

Created a new template called "Search", with the following code.

<div id="search">
    <form method="get" action="" class="dwsearch">
        <fieldset>
            <input type="text" name="s" id="search-text" size="15" />
            <input type="submit" id="search-submit" value="Søk" />
        </fieldset>
    </form>
</div>
<div id="content" class="dwcontent" title="Main content"></div>

Applied the template to the page, and the search box appears as normal.
But when I search I get no results, not even a text saying "No result", so I dont think it is implemented correctly.

 

This is how my page looks like (attachment)

 

search.PNG

Replies

 
Morten Bengtson
Reply

You need to add a page to the website with the Search (weighted) module where you can display the search results.

 

By default, the first page on the website with the search module will be used, but if you have more than one page with the search module you can specify which one should be used by including a hidden input field with the ID of the page...

<form method="get" action="" class="dwsearch">
    <input type="hidden" name="ID" value="123" />
    <fieldset>
        <input type="search" name="q" value="" />
        <input type="submit" value="Search" />
    </fieldset>
</form>

 

 
Martin Grønbekk Moen
Reply

Thanks, but I already have created a new page for it.

Still it does not work.

 

I also have the same problem with the "Forms" module, the content of the form is not shown.

Can this be related to any license error, does DW require a license for these modules to work?

 
Morten Bengtson
Reply
This post has been marked as an answer

Maybe you are using a paragraph template that is missing the ParagraphModule tag?

Votes for this answer: 1
 
Martin Grønbekk Moen
Reply

Hehe... of course. I was missing that!

Thanks again :)

 

You must be logged in to post in the forum