We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38547
    • 98 Posts
    I need a little help getting this thing to work, for starters it does work if I put just the following into the template
    [[!SimpleSearchForm?]]
    
    <p> </p>
    <p>[[!SimpleSearch]]</p>


    My problem is the search form box goes right across the page so then I created a chunk and called it like this &tpl=`SearchFormTpl` which did not output anything however the search box was contained inside my div, I spent ages reading and trying other stuff with no results output but could anyone post a basic input form which would get me up and running.

    Many thanks
      • 38547
      • 98 Posts
      I have now managed to get the default form to view ok using this css
      #search {
      
      	margin-top: 15px;
      	
      	margin-bottom:10px;
      
      	position:relative;
      
      	display: block;
      
      	width:140px;
      
      	z-index:900;
      
      	padding-right: 5px;
      
      
      }
      


      But above the form is the word search, does anyone know where I need to edit to clear this.

      Many thanks

      Quick edit.

      I found a file at core/packages/simplesearch-1.6.0-pl/modCategory/bc4ce694fb0f40c8e7f4194d1d14745e/0/simplesearch/lexicon/en/default.inc.php

      Inside this was this $_lang['sisea.search'] = 'Search';

      SO I changed it to $_lang['sisea.search'] = ' ';

      But I still get the word "search" appear above the default form.

      I have also been though the Lexicon and found 1 item there with the word Search so i edited that but still no luck.

      Can anyone give me any advice

      Cheers [ed. note: ianman last edited this post 14 years, 1 month ago.]
        • 10208 ☆ A M B ☆
        • 1,780 Posts
        Without using the sisea defaults (which I don't understand so well personally), you can use SimpleSearch with your own templates and chunks. The following is from the Flexibility basic site package, available in Package Management. Many Thanks to http://designfromwithin.com"" target="_blank" rel="nofollow">Design From Within


        Create Search Results Template:
        (assumes site header and footer are chunks)
        [[$siteHeader]]
        [[*content]]
        [[!SimpleSearch? &searchIndex=`your_search_field`]]
        [[$siteFooter]]


        Create a search results resource and attach the SearchResults template, note the ID. (assuming ID 12 here)

        Create searchFormTpl chunk (use with CSS below and searchButton.png - attached:
        <form id="my_id" action="[[~[[+landing:default=`[[*id]]`]]]]" method="[[+method:default=`get`]]">
        	<fieldset class="search">
        		<input id="searchField" class="my_class box" type="text" name="your_search_field" value=""/>
        		<button class="btn" title="Submit Search">Search</button>
        	</fieldset>
        
            <input type="hidden" name="id" value="[[+landing:default=[[*id]]]]" />
        </form>



        To call SimpleSearch in resource or template:
        <div class="search">[[!SimpleSearchForm? &tpl=`SearchFormTpl` &landing=`12` &hideMenu=`1`]</div>


        Here's some CSS to get you started:

        .search {
             float: right;
             margin-bottom: 20px;
        }
        input#searchIcon {
            width: 29px;
            height: 24px;
            background: url(images/misc/searchButton.png) no-repeat 0 0;
        	
        }
        input#searchIcon:hover {
            background: url(images/misc/searchButton.png) no-repeat 0 -24px
        }
        fieldset.search {
            border: none;
            margin: 0 auto;
            padding-right: 0px;
        }
        .search input,
        .search button {
            border: none;
            float: left;
        }
        .search input.box {
            color: #000000;
            font-size: 1.2em;
            width: 190px;
            height: 24px;
            padding: 0px 3px 0px 3px;
            background: #ffffff;
            margin-right: 5px;
            border: 1px solid #000000;
        }
        .search input.box:focus {
            background: #ebebeb;
            outline: none;
        }
        .search button.btn {
            width: 29px;
            height: 24px;
            cursor: pointer;
            text-indent: -9999px;
            background: url(images/misc/searchButton.png) no-repeat top right;
        
        /*positions button at right inside of search box, delete to place to the outside right of search box*/	
                position: absolute;
        	left: 175px;
        }
        .search button.btn:hover {
            background: url(images/misc/searchButton.png) no-repeat bottom right
        }
        [ed. note: frogabog last edited this post 14 years, 1 month ago.]
          Frogabog- MODX Websites in Portland Oregon
          "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
          Having server issues? These guys have MODX Hosting perfected - SkyToaster
          • 38547
          • 98 Posts
          Thanks Frogabog thats exactly what I was after really appreciated.

          Thanks again

          Ian