Fork me on GitHub

Watch

GitHub Core

Show your support for Zikula! Sign up at Github account and watch the Core project!




GitHub Modules

Forum Activity

Forum feed

» Visit forum | » View latest posts

Somara Gray/Gridlockpn64 CSS & Admin Messages  Bottom

  • 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?
  • 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
  • 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!
  • 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

This list is based on users active over the last 60 minutes.