1
SMEDrieben
Template of search.php ??
  • 2016/2/22 20:20

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


I would like to change the layout of thehttp://mysite/search.php (advanced search page)

It feels stupid, but I cannot find a template that defines this page. I want to change the colors, background-color etc.

Where can I change the layout of this page ?

SMEDrieben

2
zyspec
Re: Template of search.php ??
  • 2016/2/22 21:45

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


You're not being stupid...

XOOPS search does not use templates. You will find most of the html generation (for the form) is created in ./include/searchform.php. There's very little styling done there since it uses XoopsForm - so to make changes to the CSS you'll either have to modify the searchform.php file directly or modify the theme or base (xoops.css) files to get what you want.

The html generated as the result of a search is primarily done through ./search.php directly. Again, styling is done "inline" with the code so you'll have to modify the php file.

I know this is one of the things that's been talked about "fixing" in the past but doubt any changes will be made to this code before XOOPS 2.6

3
Peekay
Re: Template of search.php ??
  • 2016/2/23 16:30

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


I have been working with the xbootstrap theme recently and it is really good, however the checkboxes for selecting modules on the 'search results' page (and everywhere else for that matter) are presented in a horizontal line. The line doesn't break when the page is viewed on a mobile phone, so I hacked the code to display checkboxes underneath each other.

This is bad practice, invalid HTML and of course it affects every checkbox array on the site... but it makes the boxes easy to select on a phone and they don't break out of the viewport.


/class/xoopsform/formcheckbox.php

Around line 208

Change:

$ret .= $ele_extra ' />'."<label name='xolb_{$ele_name}' for='{$ele_id}{$id_ele}'>" $name "</label>" $ele_delimeter ;


to:

$ret .= $ele_extra ' />'."<label name='xolb_{$ele_name}' for='{$ele_id}{$id_ele}'>" $name "</label><br clear='all' />" ;

4
SMEDrieben
Re: Template of search.php ??
  • 2016/2/23 20:19

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


Thanks ! How can I increase the size of the check buttons ?

SMEDrieben

5
Peekay
Re: Template of search.php ??
  • 2016/2/24 9:02

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


This is my search CSS. Obviously the values may not apply to your theme, but it shows the targets. A height and width setting for the checkbox input may change the box size, although I haven't tried it.

/* pk ---------- Search (table) -------------- */

form#search{
  
displayblock;
  
width90%
}

form#search input[type="checkbox"] {
floatleft;
line-height1.5;
margin4px 0 4px 0;
}

/* pk checkbox label */
form#search label {
  
floatleft;
  
margin0 10px 0 10px
}

form#search select{
width100%;
height35px
}

form#search input[type="button"], input[type="submit"]{
margin5px 0 0 0;
}

form#search input[type="text"] {
width100%
}

6
Peekay
Re: Template of search.php ??
  • 2016/2/24 9:23

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


... and some more. I should point out that I am using Xoops 2.5.5 so the CSS identifiers may have changed in later versions.


/* heading */
form#search th {
padding10px 0 5px 0;
font-familyamblelight;
font-size30px;
font-weightnormal;
color#006600;
background-colortransparent;
}

form#search tr {
height45px;
}

/* caption */
form#search .caption-text {
colorblack;
margin-right1px
}
/* caption marker e.g. asterisk */
form#search .caption-marker {
colorred;
margin-right2px
}

7
SMEDrieben
Re: Template of search.php ??
  • 2016/2/29 14:52

  • SMEDrieben

  • Not too shy to talk

  • Posts: 173

  • Since: 2009/6/17


Thanks for all suggestions ! I applied some of them and they do work !

SMEDrieben

Login

Who's Online

251 user(s) are online (129 user(s) are browsing Support Forums)


Members: 0


Guests: 251


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits