HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[v5.0.3] Search Block

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#66484 (In Topic #14189)
Avatar

Community saint

I've been trying to play around with the template to change it from a side block looking search box



To a search box that looks like this



Unfortunately I am having no luck. Anyone want to give it a go? Or has anyone already done it?

It's going to be used on the main site page at the top, so a side block looking search box is not ideal for the site.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#66485
Avatar

Isn't it just a simple case of changing the BLOCK_MAIN_SEARCH.tpl template?

This is an example from one of my sites.

Code


<form onsubmit="if (typeof this.elements['contents']=='undefined') { disable_button_just_clicked(this); return true; } if (checkFieldForBlankness(this.elements['contents'],event)) { return true; } return false;" action="{$URL_FOR_GET_FORM*,{URL}}" method="get">
   {$HIDDENS_FOR_GET_FORM,{URL}}

   <label class="accessibility_hidden" for="search_content">{!SEARCH}</label>
   <input class="search-box" onkeyup="update_ajax_search_list(this);" type="text" id="search_content" name="content" value="" />

   <input name="SEARCH" type="submit" class="search-but" value="{!SEARCH}" />

   {+START,LOOP,LIMIT_TO}
      <input type="hidden" name="{_loop_var*}" value="1" />
   {+END}
   {+START,LOOP,EXTRA}
      <input type="hidden" name="{_loop_key*}" value="{_loop_var*}" />
   {+END}
   <input type="hidden" name="author" value="{AUTHOR*}" />
   <input type="hidden" name="days" value="{DAYS*}" />
   <input type="hidden" name="sort" value="{SORT*}" />
   <input type="hidden" name="direction" value="{DIRECTION*}" />
   <input type="hidden" name="only_titles" value="{ONLY_TITLES*}" />
   <input type="hidden" name="only_search_meta" value="{ONLY_SEARCH_META*}" />
   <input type="hidden" name="boolean_search" value="{BOOLEAN_SEARCH*}" />
   <input type="hidden" name="conjunctive_operator" value="{CONJUNCTIVE_OPERATOR*}" />
</form>


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#66506
Avatar

Community saint

I've been trying to edit that template, but it never comes out how I want it to look.  :lol:

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#66507
Avatar

Community saint

Fascinating … !!

I've bookmarked this thread for future ref.

Hope it gets resolved!

 :thumbs:

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#66508
Avatar

Community saint

I didn't my exact results, but it looks nice in the end…



I'll continue tampering with it.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#66518
Avatar

Community saint

Good one, Eric.

Share the code when you're finished … ??

 :)

Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#66524
Avatar

Community saint

Fletch said

Good one, Eric.

Share the code when you're finished … ??

 :)
Indeed, nice looking page Eric:thumbs:
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: