Hi,
I would like to place the search box and the login boxes in the header of a site ... But I've run into some problems...
For the search box :
I understand that I could select the 'header' option for the block and put the print $header statement into a div wich is appropriate. But the problem is that the title of the block then still appears. How do I get rid of it ? Second, when I do this, there is a difference in the way that IE and FF render the solution. Because IE will place a wich will leave me with whiteapace, while FF does not! What would be the solution to this difference ??
For the login box :
More or less the same problem. Also here I have all this extra info wich is provided with the login box and needs to be not there .. Again, there is an extra white line in IE ...
Anyone know how to do this ?
Gdev
Comments
Hmm nobody ??? Gdev
Hmm nobody ???
Gdev
Me too
I'd like to do something similar to this as well.
I'm not sure what you mean with the search box. Many of the themes already have a search box in the header. I've used the approaches I've found there. Based on the $search_box variable a special set of code is implemented in the header region. This is different than the search_block that normally shows up in the side bars.
The block version of the search and the block version of a login are OK for the sidebars but for the header they are simply not usable.
What I'd like to do for the login are is to toggle a special implementation of the login are in the header which bypasses the block version of a login. The goal would be that when the webmanager selects the login block to be placed in the header my special situation would be used. Otherwise the header would not copntain a login area.
If you find out a way to detect the presence of a login block in the header let me know.
Thanks
Andy Potter
Have a look at tournure
Have a look at tournure management http://www.tournuremanagement.nl . You will see the search field in the header which is done by adjusting the placement of the search field in your block page to header.
The title can be made invisible by using css. I believe it is a H2 property which you have to set to display:none;
Works perfectly in FF as in IE
Hope this helps
Hey
You might try going into themes, then configure your selected theme, there's a search option in there that puts a box under your primary links. (on the right side at the top)
Hope this helps
What I want is a bit more complicated.
For my purposes the search function is no problem. Setting the toggle in the themes configuration does the trick.
What I'd like to do involves the login block. In the blocks configuration section you can select where the login block should appear Left, Right, Content, Footer and/or Header. I would like my theme to create a special login form, when the login block is placed in the header region. In all the other regions the login block should stay as it is. This standard login block look, however, is ugly when placed in the header. I would like my them to react when the login block is in the header and create a specially designed form for the login. You might say I want to theme the login block, when it is in the header (I think the light bulb just went on in my head :) ).
I'm beginning to get the impression that this is not possible within page.tpl.php or at least not practical. It most likely should be done in the user.module and possbly the block.module as well. Unfortuneately I'm not yet acquianted with the inner workings of these modules enough, in order to do what I want.
The, only alternative then is to have a login block permanently displayed in the header. This is what I was trying to avoid.
Do you mean that you want to
Do you mean that you want to have the login block in the header on your frontpage and somewhere else on the rest of the pages?
No
I just want the Login Block to have a different "look and feel" when it is placed into the header. I want the theme to have the flexibility of placing the login block wherever the webmaster chooses. However, when the webmaster decides to place the login block in the header the theme should produce a login-block that is appropriate for a header and not the standard login-block that appears in the sidebars.
I think this may need to be done in the block.tpl.php file but have not yet had time to investigate this. In my original question I was attempting to find a way to do this from within page.tpl.php.
Using CSS should do the
Using CSS should do the trick. Just use #header .form-item to style your login when placed in the header which will mean that if it is not placed in the header the login block will be styled differently.
$block->region
$block->region is what you are looking for.
You can either switch on $block->region in block.tpl.php or do some magic in template.php eg in the _phptemplate_variables() function.
Yet another option would be to devise the appropriate CSS selector to style the block with.
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
Thanks
The block->region suggesiton confirms my idea about block.tpl.php.
Also the suggestions for CSS are also good ideas which I hadn't tought of.
I'll give it a try.