Hi everyone,

I need to query my Drupal site and other external websites (just standart url query) in the same search interface.
I use the custom form module and the custom path option with radio button selector. So far so good.

Now I need to display my radio buttons as tabs with pure css and no js. The goal is to hide the radio buttons and display labels inline.
I found a good article that explain this technique : http://alistapart.com/article/radio-controlled-web-design

In a previous version of custom search module (7.x-1.18) everythings works as expected. My labels were nicely htabs with the current tab (label) highlited and the inputs nicely hidden.

Right now it doesn't work anymore because the inputs (wich I could use to find the pseudo-class :checked) are included in the labels and the css selector could not work this way :

<label class="control-label" for="edit-custom-search-paths-test-key">
<input id="edit-custom-search-paths-test-key" class="form-radio" type="radio" checked="checked" value="http://asite/search?ho=t&l=fr-FR&q=[key]" name="custom_search_paths">
Testing url
</label>

And I need :

<input id="edit-custom-search-paths-test-key" class="form-radio" type="radio" checked="checked" value="http://asite/search?ho=t&l=fr-FR&q=[key]" name="custom_search_paths">
<label class="control-label" for="edit-custom-search-paths-test-key">
Testing url
</label>

So I could use :checked pseudo-class and the sibling selector ~ to style elements that follow the element in the same level.

Exemple css :

.form-radio:checked ~ .control-label {
    background: white none repeat scroll 0 0;
    box-shadow: 0 0 3px 3px rgba(253, 53, 17, 0.5);
}

I try to read the code and find how I could change the output but no luck for the moment...

Could you please point me to the good direction please ?

Thank you very much

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

coolidfrez created an issue. See original summary.

jdanthinne’s picture

Code for the checkboxes hasn't been changed in version 1.19… and the output of checkboxes is handled by Drupal Core itself, so you should try overriding the theming of those I think.

coolidfrez’s picture

Thank you for your very quick reply.
You are totally right, I update my bootstrap theme to version 3 and I think that where I need to look !

jdanthinne’s picture

Status: Active » Closed (works as designed)