I listed two themes because I have seen the theme I'm using at http://www.houseoftom.com referred to as both.
Default for this theme (gridlock) is a light background and light blocks. But I prefer a darker background with the same, light blocks.
Problem: Admin_Messages do not go in blocks, they sit directly on my bg. Text for Admin_Messages is dark, as is my background. Next problem - the CSS style sheets are for ALL the text, so if I changed the text to light colored (to see Admin_Messages) the text in the blocks is nearly invisible.
Question: How can I create/specify a new CSS style sheet that deal DIRECTLY and SOLELY with Admin_Messages?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- mdee responded to »Short URL questions« 12:02 AM
- mesteele101 responded to »Problem in Database Connection« 21. May
- mesteele101 created topic »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 20. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. May
- mesteele101 responded to »How to install Zikula for MSSQL ??? - Part II« 19. May
- mesteele101 created topic »File packaging« 16. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
Somara Gray/Gridlockpn64 CSS & Admin Messages
-
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 676
In the theme, you wrap the output of the Admin message in a custom class. It is output at the very bottom of the theme, at the end of the themesidebox function where the sideblocks are output. It can look a little different in different themes. For instance, PostNuke:
Code
function themesidebox($block) {
echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
if (!empty($block['title'])) {
echo "<tr bgcolor=\"$GLOBALS[sepcolor]\">\n"
."<td><img src=\"themes/$GLOBALS[thename]/images/pix-t.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
."</tr>\n"
."<tr>\n"
."<td align=\"center\" valign=\"top\">\n"
."<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">\n"
."<tr>\n"
."<td class=\"pn-title\">$block[title]</td>\n"
."</tr>\n"
."</table>\n"
."</td>\n"
."</tr>\n"
."<tr bgcolor=\"$GLOBALS[sepcolor]\">\n"
."<td><img src=\"themes/$GLOBALS[thename]/images/pix-t.gif\" width=\"1\" height=\"1\" alt=\"\" border=\"0\"></td>\n"
."</tr>\n"
."<tr>\n";
}
echo "<td align=\"left\" valign=\"top\" class=\"pn-normal\">$block[content]</td>\n"
."</tr>\n"
."</table><br />\n";
}
?>
Here it uses the fact that th eAdmin message has no Block Title, so it outputs sideblocks if there is one, and simply dumps the Admin message (in the $block array) without a table at the end, with the generic PN-normal class, which it all uses. Change it to saomething less gereric, like "AdminMsg" or something:
Code
echo "<td align=\"left\" valign=\"top\" class=\"pn-normal\">$block[content]</td>\n"
This is also where you'd wrap a table around it, if you know some basic PHP. This is where it's bad to encase all the HTML in PHP echo statements, as it's to be used by non-programmers. It's quite pointless, actually.
The style rule may be something like
Code
TD.AdminMsg {
font: 11px Verdana, Helvetica;
color: white;
}
The rule ofthumb is that the more specific a rule, the greater its precedence. So TD.AdminMsg is more specific than .AdminMsg, and if the title of the block is centered and bold,
TD.AdminMsg center B .pn-title { ... }
or whatever the order of tags and classes is. It's handy to study the browser source for this, messy as it is. Use the Search function to find the heading, and look at the surrounding code.
PostNukeBlue:
Code
function themesidebox($block) {
if (empty($block['position'])) {
$block['position'] = "a";
}
//Begin Left Block
if ($block['position'] == 'l') {
include("themes/$GLOBALS[thename]/leftblock.html");
}
//Begin Right Block
if ($block['position'] == 'r') {
include("themes/$GLOBALS[thename]/righblock.html");
}
//Begin Center Block
if ($block['position'] == 'c') {
echo "$block[content]<br />";
}
}
?>
postNukeBlue specifically checks the position of the block. If it's "c" - Center - then it output the Admin message, no frills, no tables.
Themes sometimes check for l=left and r=right blocks, and whetever is left over must be Admin. It's always last, though.
Hope that helps...
Martin :D -
**unknown user**
- Rank: Registered User
- Registered: Mar 16, 2002
- Last visit: May 28, 2004
- Posts: 40
I tried what you suggested, but I could never get the code to work. I will keep hackin' away at it.
Regardless, THANKS SO MUCH. I learned a lot simply from your post. w00t! -
**unknown user**
- Rank: Helper
- Registered: Mar 16, 2002
- Last visit: Oct 21, 2009
- Posts: 676
In the abovementioned themesidebox section at the end, where currently you have $block[content] on its own, try
Code
//Begin Center Block
if ($block['position'] == 'c') {
opentable();
echo "$block[content]<br />";
closetable();
}
opentable and closetable are the generic 100% width tables used by various modules as a themed background, defined at the top ofthe theme file.
Otherwise, post the relevant section from the end of the themesidebox section.
Martin :D
- Moderated by:
- Support
