Fork me on GitHub

Admin Messages - Too much space at the top  Bottom

  • Using PN 7.50
    How do we get rid of the extra space at the top of an admin message block? It's as if several scripts are being called to produce the admin message block and are adding their own
    's above the title.

    This isn't a theme problem, because it shows up on all themes (or at least all of the themes I've tried).

    I checked modules/NS-Admin_Messages/messages.php and found:

    Code

    $ttitle .= $output->Linebreak();
    $ttitle .= $output->Text($title);
    $ttitle .= $output->Linebreak(2);

    towards the end of the file.
    I commented out the 1st line seen above and that indeed moved the title up one line. However, there still appears to be 2-3 spaces remaining.

    Anyone able to help with this?

    Thanks...
  • That's because the $title in an Admin message is always NULL I believe, so that line and the linebreak below add additional space.
  • Actually, the $title isn't NULL.... its the title of the message. If you do this:

    Code

    //$ttitle .= $output->Linebreak();
    $ttitle .= $output->Text($title);
    $ttitle .= $output->Linebreak(2);

    ...your article will display at the very top. HOWEVER!!! Keep in mind that it's possible to have a
    tag in either your master template or in the block template if you're using AT or XTE... and of course, don't forget that the main table in the layout may have some padding on it too, either directly or via CSS.

    Also...if you don't care to use the title in the Admin Messages, just comment out all three lines above...
  • I'm using AT (Dezina-Trinidad).

    alarconcepts

    If you do this:

    Code

    //$ttitle .= $output->Linebreak();
    $ttitle .= $output->Text($title);
    $ttitle .= $output->Linebreak(2);

    ...your article will display at the very top.


    As I indicated above, I tried that and while it removed one line, the title still appears to be at least 2 lines below the top.

    Quote

    HOWEVER!!! Keep in mind that it's possible to have a
    tag in either your master template or in the block template if you're using AT or XTE... and of course, don't forget that the main table in the layout may have some padding on it too, either directly or via CSS.


    Hmm.. but as I say, it appears on all of the themes I've tried.
    The relevant portion of the master template (theme.html):

    Code

    <!-- [left-blocks] -->
    </td><td valign="top"><img src="{image-path}pix.gif" width="10" height="1" border="0" alt=""></td><td width="100%" valign="top">
    <!-- [center-blocks] -->
    <!-- [modules] -->

    ...shows no
    's.

    I checked the center block template:

    Code

    <!-- [open-table] -->
    <div align="center">
    <!-- [block-title] -->
    <br /><br />
    <!-- [block-content] -->
    </div>
    <!-- [close-table] -->

    ... no
    's there either.

    I'm stumped! :?

    Let me ask y'all this: is anyone else experiencing this 'phenomenon'? I seem to recall reading something about this here some time ago, but when I went searching, I couldn't find it.
  • I got rid of this "phenomenon" by commenting out that one line...
  • craigh

    That's because the $title in an Admin message is always NULL I believe, so that line and the linebreak below add additional space.


    Craigh,
    I really don't understand this (sorry). Can you explain further and is there a way to 'fix' it?

    Thanks!
  • alarconcepts

    I got rid of this "phenomenon" by commenting out that one line...


    Hmm... Wish it was doing the job for me! :)
  • That would mean that the $title variable was NULL (or in other words, nothing) ... but this is not the case, because it does in fact print out the title with the Admin Message...
  • A link to the offensive item would be helpful in rooting out the issue...
  • How long is your message? It's possible the valign of the table cell that contains the Admin Message is set to middle or something similar. Check and see what your site is rendering.

    Frank
  • Testing123

    craigh

    That's because the $title in an Admin message is always NULL I believe, so that line and the linebreak below add additional space.


    Craigh,
    I really don't understand this (sorry). Can you explain further and is there a way to 'fix' it?

    Thanks!


    Well, I'll admit I wasn't clear. But I'm doing this from memory...

    I'm pretty sure the regular ccblock.htm template is used to enclose ALL the admin messages, so there is a TITLE field in that block that will be NULL, because the "Admin Messages" title is not passed to the block (IIRC). This causes a blank at the top.

    you can insert code in the ccblock.htm that checks for the title...

    Code

    <!--[if $title != ""]-->
        <tr>
            <td class="pn-title">
                <!--[$title]-->
            </td>
        </tr>
    <!--[/if]-->


    Of course, this is all dependant on your theme and AT will differ slightly from Xanthia.

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