How to Search Blogs?

Topics: General
Sep 9, 2011 at 6:55 PM

The general search feature that comes with the system only search for content on the pages, right?  How can I implement it to search blog contents and old blog articles?

Thank you!

Coordinator
Sep 12, 2011 at 7:53 AM

Hello,

If you use Omnicorm Demo site, so it has installed Simple Page Search module which search only on page contents. If you wish to have advanced search and website is public then consider to use one of the Google based search packages - one is free, one is 100% skinnable.

Sep 13, 2011 at 7:36 AM

I too recommend the Google Search. It really takes the guess work out of search and it's just so much less painful than rolling your own. Trust me, I've done this and unless you've got someone writing a search engine, it's really hard stuff.

Sep 14, 2011 at 6:00 PM

So the free one is not skinnable, Inna?  Is it easy to use, Atomiton?

Coordinator
Sep 16, 2011 at 7:13 AM

>> So the free one is not skinnable, Inna?

Sorry, both free and commercial editions are skinnable. The disadvantage of the free version is that it shows Google ads in search results.

Sep 16, 2011 at 8:36 AM
Edited Sep 16, 2011 at 8:37 AM

Google makes it straightforward... the functions you will need:

Create a Search Form Function or modify the Composite.Search.SimplePageSearch.SearchForm

Add a function call to Composite.Web.Request.Querystring that looks for parameter "q" (or choose something else like "search" if you like)

Add this markup to the body tag of the stylesheet:

 

<form action="/Renderers/Page.aspx?pageId={$searchResultPage}" method="get" id="SearchForm">
  <input type="text" class="text span-2" name="q" placeholder="{$searchButtonLabel}" maxlength="1000">
    <xsl:if test="not($searchQuery='')">
       <xsl:attribute name="value">
          <xsl:value-of select="$searchQuery" />
       </xsl:attribute>
    </xsl:if>
  </input>
  <button type="submit" value="Go"><img src='/frontend/images/icons/search.gif' alt='' />Go</button>
</form>

All this form is is an input box and a button. "button" elements are easier to style. This goes on every page you want a search box. I'd put it in a layout. 

I also use the variables:

 

  <xsl:param name="searchResultPage" select="{GUID of C1 PAGE here}" />
  <xsl:param name="searchQuery" select="/in:inputs/in:result[@name='SearchQuery']" />

 

The SearchResultPage is simply a parameter so I can choose where the C1 page results will be (where I will be posting the search query to)

SearchQuery is simply the QueryString Function Call

THEN, it's just a matter of copying and pasting the code from Google Site Search once you create your "Search Engine" at http://www.google.com/sitesearch/

If you don't care about the Google Branding, then Google Site Search is free. Don't forget to use Google's Webmaster tools to update your site map on the page. I never say ANYTHING to do with web development is simple... but if you follow the steps on their site, you shouldn't have too many problems. It's more a matter of copy n' paste than anything else. They have a built-in theme builder as well which will help you out... but they're a bit ugly.

 

 

  
  

 

Coordinator
Sep 16, 2011 at 9:05 AM
Edited Sep 16, 2011 at 9:06 AM
atomiton wrote:

Create a Search Form Function or modify the Composite.Search.SimplePageSearch.SearchForm

....

 

Or use C1 Google Site Search package or Google Custom Search package.

Sep 16, 2011 at 9:46 AM

Thank you, Atomiton for the sample. It helps b/c I'm so new to web development and C1.  Thanks, Inna for the pointer