Thanks for the help with login page. I am working on that now, and that seems to be going ok.
Now, I am working on the Menu System, and I have created some new menus.
This is probably a very easy question ... but for different menus, I'd like to have different styles for different menu names. Along that line ... I'd like to have different styles for different blocks.
I am going through on how to make themes, and I am looking online and through my book "Pro Drupal Development"
I may find my answer soon, but if anyone wants to point me to the right direction, that would be great!
Thanks! Tom
Hello, Tom,
If I understand your question correctly, you have done the following steps:
1. Created the menus at the menu admin screen.
2. Displayed those menus in a region of your theme via the block config menu --
If this is the case, every block has a unique ID, and you could target individual blocks via css. Alternately, and this would be more complex but ultimately more flexible, you could set up a php snippet in your template.php (or maybe even create a small helper module) that examined block titles, and then applied css based on the text of the title.
In some ways, the second option could be pretty slick: an admin screen where you identified the text to look for in the block title, and then a textarea where you entered the css override. But that would be a fair amount of work to accomplish something you can do pretty quickly within the stylesheet.
You also might want to check this out: http://drupal.org/node/74481 -- it's a bit dated, but is still pretty relevant.
Also, what I'm suggesting assumes that you are displaying your menus via blocks.
Cheers,
Bill
Tom Holmes Jr. wrote:
Thanks for the help with login page. I am working on that now, and that seems to be going ok.
Now, I am working on the Menu System, and I have created some new menus.
This is probably a very easy question ... but for different menus, I'd like to have different styles for different menu names. Along that line ... I'd like to have different styles for different blocks.
I am going through on how to make themes, and I am looking online and through my book "Pro Drupal Development"
I may find my answer soon, but if anyone wants to point me to the right direction, that would be great!
Thanks! Tom
Bill Fitzgerald wrote:
Hello, Tom,
If I understand your question correctly, you have done the following steps:
Created the menus at the menu admin screen.
Displayed those menus in a region of your theme via the block config
menu --
Yes, and yes .... nothing special there ....
If this is the case, every block has a unique ID, and you could target individual blocks via css. Alternately, and this would be more complex but ultimately more flexible, you could set up a php snippet in your template.php (or maybe even create a small helper module) that examined block titles, and then applied css based on the text of the title.
In some ways, the second option could be pretty slick: an admin screen where you identified the text to look for in the block title, and then a textarea where you entered the css override. But that would be a fair amount of work to accomplish something you can do pretty quickly within the stylesheet.
I'll stick to the more simple solution of css for now ... how do I figure out the unique id of the block though. I'm guessing within the block.tpl.php is where I would put this css data? That would be fine with me. It's too bad I can't create a block-menu_name.tpl.php, that would be much simpler and would seem to keep in line with the other standards of Drupal. According to the Pro Drupal Development book on Page 120, we can do: block-modulename-delta.tpl.php block-modulename.tpl.php block-region.tpl.php
Not sure what the 'modulename' is though.
You also might want to check this out: http://drupal.org/node/74481 -- it's a bit dated, but is still pretty relevant.
Ok, thanks! I will definitely take a look.
Also, what I'm suggesting assumes that you are displaying your menus via blocks.
Yep ... that is what I am doing. I figure it is the BEST way to do this since I do have hierarchical menus. I did create one TEST block with just grabbing, cutting/pasting some HTML (and javascript) code into a block, but that didn't work out so well for my menus. I think it would be best to use the Menu System rather than create blocks with HTML.
Thanks again for the help! Tom
Cheers,
Bill
Tom Holmes Jr. wrote:
Thanks for the help with login page. I am working on that now, and that seems to be going ok.
Now, I am working on the Menu System, and I have created some new menus.
This is probably a very easy question ... but for different menus, I'd like to have different styles for different menu names. Along that line ... I'd like to have different styles for different blocks.
I am going through on how to make themes, and I am looking online and through my book "Pro Drupal Development"
I may find my answer soon, but if anyone wants to point me to the right direction, that would be great!
Thanks! Tom
You can use either of those options. the css should go in style.css in your theme folder and the best way to find out the name is to simply view source. You probably want to do whatever you can in css before messing with the template route.
As for using the template route, what you're finding on page 120 is what you need. The modulename would be the name of the module you're using. If you're using the standard menu system I think it will be block-menu.tpl.php or block-menu-1.tpl.php or something along those lines. Then there is also the option of the region as listed - block-left.tpl.php would target the left region.
I'll stick to the more simple solution of css for now ... how do I figure out the unique id of the block though. I'm guessing within the block.tpl.php is where I would put this css data? That would be fine with me. It's too bad I can't create a block-menu_name.tpl.php, that would be much simpler and would seem to keep in line with the other standards of Drupal. According to the Pro Drupal Development book on Page 120, we can do: block-modulename-delta.tpl.php block-modulename.tpl.php block-region.tpl.php
Not sure what the 'modulename' is though.
You also might want to check this out: http://drupal.org/node/74481 -- it's a bit dated, but is still pretty relevant.
Ok, thanks! I will definitely take a look.
Also, what I'm suggesting assumes that you are displaying your menus via blocks.
Yep ... that is what I am doing. I figure it is the BEST way to do this since I do have hierarchical menus. I did create one TEST block with just grabbing, cutting/pasting some HTML (and javascript) code into a block, but that didn't work out so well for my menus. I think it would be best to use the Menu System rather than create blocks with HTML.
Thanks again for the help! Tom
Cheers,
Bill
Tom Holmes Jr. wrote:
Thanks for the help with login page. I am working on that now, and that seems to be going ok.
Now, I am working on the Menu System, and I have created some new menus.
This is probably a very easy question ... but for different menus, I'd like to have different styles for different menu names. Along that line ... I'd like to have different styles for different blocks.
I am going through on how to make themes, and I am looking online and through my book "Pro Drupal Development"
I may find my answer soon, but if anyone wants to point me to the right direction, that would be great!
Thanks! Tom
Ah ... well, I was looking at the link Bill suggested and as I read through the thread, it suggests that I not use the id. However the thread refers to drupal 4.7, so I am not sure if it still applies to 5.5. Someone on the thread suggested that the id may change if you change the position of the block.
I agree with you that I should stick with the css route for simplicity.
sander-martijn wrote:
You can use either of those options. the css should go in style.css in your theme folder and the best way to find out the name is to simply view source. You probably want to do whatever you can in css before messing with the template route.
As for using the template route, what you're finding on page 120 is what you need. The modulename would be the name of the module you're using. If you're using the standard menu system I think it will be block-menu.tpl.php or block-menu-1.tpl.php or something along those lines. Then there is also the option of the region as listed - block-left.tpl.php would target the left region.
I'll stick to the more simple solution of css for now ... how do I figure out the unique id of the block though. I'm guessing within the block.tpl.php is where I would put this css data? That would be fine with me. It's too bad I can't create a block-menu_name.tpl.php, that would be much simpler and would seem to keep in line with the other standards of Drupal. According to the Pro Drupal Development book on Page 120, we can do: block-modulename-delta.tpl.php block-modulename.tpl.php block-region.tpl.php
Not sure what the 'modulename' is though.
You also might want to check this out: http://drupal.org/node/74481 -- it's a bit dated, but is still pretty relevant.
Ok, thanks! I will definitely take a look.
Also, what I'm suggesting assumes that you are displaying your menus via blocks.
Yep ... that is what I am doing. I figure it is the BEST way to do this since I do have hierarchical menus. I did create one TEST block with just grabbing, cutting/pasting some HTML (and javascript) code into a block, but that didn't work out so well for my menus. I think it would be best to use the Menu System rather than create blocks with HTML.
Thanks again for the help! Tom
Cheers,
Bill
Tom Holmes Jr. wrote:
Thanks for the help with login page. I am working on that now, and that seems to be going ok.
Now, I am working on the Menu System, and I have created some new menus.
This is probably a very easy question ... but for different menus, I'd like to have different styles for different menu names. Along that line ... I'd like to have different styles for different blocks.
I am going through on how to make themes, and I am looking online and through my book "Pro Drupal Development"
I may find my answer soon, but if anyone wants to point me to the right direction, that would be great!
Thanks! Tom
you can usually do the css without using the id. I can vouch that in 5 it can still be an issue. I recently installed block cache on a site for performance (it's quite an impressive improvement btw) and the whole site fell apart because all the ids changed. I had to go through and edit all the css finding the new names and adding them in. Was quite a pain.
Tom Holmes Jr. wrote:
Ah ... well, I was looking at the link Bill suggested and as I read through the thread, it suggests that I not use the id. However the thread refers to drupal 4.7, so I am not sure if it still applies to 5.5. Someone on the thread suggested that the id may change if you change the position of the block.
I agree with you that I should stick with the css route for simplicity.
sander-martijn wrote:
You can use either of those options. the css should go in style.css in your theme folder and the best way to find out the name is to simply view source. You probably want to do whatever you can in css before messing with the template route.
As for using the template route, what you're finding on page 120 is what you need. The modulename would be the name of the module you're using. If you're using the standard menu system I think it will be block-menu.tpl.php or block-menu-1.tpl.php or something along those lines. Then there is also the option of the region as listed - block-left.tpl.php would target the left region.
I'll stick to the more simple solution of css for now ... how do I figure out the unique id of the block though. I'm guessing within the block.tpl.php is where I would put this css data? That would be fine with me. It's too bad I can't create a block-menu_name.tpl.php, that would be much simpler and would seem to keep in line with the other standards of Drupal. According to the Pro Drupal Development book on Page 120, we can do: block-modulename-delta.tpl.php block-modulename.tpl.php block-region.tpl.php
Not sure what the 'modulename' is though.
You also might want to check this out: http://drupal.org/node/74481 -- it's a bit dated, but is still pretty relevant.
Ok, thanks! I will definitely take a look.
Also, what I'm suggesting assumes that you are displaying your menus via blocks.
Yep ... that is what I am doing. I figure it is the BEST way to do this since I do have hierarchical menus. I did create one TEST block with just grabbing, cutting/pasting some HTML (and javascript) code into a block, but that didn't work out so well for my menus. I think it would be best to use the Menu System rather than create blocks with HTML.
Thanks again for the help! Tom
Cheers,
Bill
Tom Holmes Jr. wrote:
Thanks for the help with login page. I am working on that now, and that seems to be going ok.
Now, I am working on the Menu System, and I have created some new menus.
This is probably a very easy question ... but for different menus, I'd like to have different styles for different menu names. Along that line ... I'd like to have different styles for different blocks.
I am going through on how to make themes, and I am looking online and through my book "Pro Drupal Development"
I may find my answer soon, but if anyone wants to point me to the right direction, that would be great!
Thanks! Tom
On 27.Dec.2007, at 01:04 PM, Tom Holmes Jr. wrote:
how do I figure out the unique id of the block though.
my life was made easier when i switched to firefox to do all my drupal designing. i use the WEB DEVELOPER extension. it has a feature called DISPLAY ELEMENT INFORMATION that is just what you need :
More here : http://chrispederick.com/work/web-developer/
Someone needs to develop a blogging and themeing DRUPAL extension for Firefox.
/ liza
Liza Sabater www.lizasabater.com www.culturekitchen.com
Along the same idea of changing the menu style ...
one of the things I wanted to do was get rid of the <li> tags? Can I do this? Or if I use the standard menu navigation, am I stuck using the <li> tags?
Thanks!
unless you want to use one of the many other menu options out there you're stuck with the <li> tags. Even if you use the others most of them use <li> as well.
You'll have to use css to make them look how you want to. setting the padding, display, list-style etc will get you whatever you want.
Tom Holmes Jr. wrote:
Along the same idea of changing the menu style ...
one of the things I wanted to do was get rid of the <li> tags? Can I do this? Or if I use the standard menu navigation, am I stuck using the <li> tags?
Thanks!