Content last modified Tuesday 24 August 2021
hop to #bottom
Categories:
Author:
About It:
Rate it:
  • Helpful?
  • 0 Yes
  • 0 No
Flag it:

If you'd like to provide updated information and do not have access to directly edit, please contact the site admin; thanks!

Tooltip popups and notes on admin screen

The basic answer is this:
to edit the admin screen, edit \textpattern\include\txp_article.php

If you’d like further instructions, keep reading…
(If the information seems really elementary, please pardon me… it took a bit of fiddling for me to figure this stuff out and I’m documenting this in detail with the expectation that I’ll have to refer to it myself in the future.)



Enable tooltips with CSS
  1. Open up \textpattern\lib\txplib_head.php
  2. Find the page header code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
  3. Add this/these line(s) after <head>:

    <style>.popup{color:#333;cursor:help;text-decoration:none}
    .popup:hover{background-color:#fc3;}</style>


    The .popup:hover style is entirely optional, you may certainly adjust the color and other styling to your preference.

Now you can add tooltips to your admin article-entry screen.



Adding text to the page
This can be general text—doesn’t have to be tooltipped.

The edits you make to the page are up to you; the page you’ll need to edit is \textpattern\include\txp_article.php

Example edits:

  • To add text next to the Title field:

    Find
    //-- title input --------------

    and add your text/html after the
    '" class="edit" size="40" tabindex="1" />

    e.g.
    '" class="edit" size="40" tabindex="1" /> Title* <span title=" Please see the \'Note on titles\' below " class="popup">[?]</span>'
  • To add text between the Body and Excerpt fields:

    Find
    echo '<textarea style="width:400px;height:360px" rows="1" cols="1" name="Body" tabindex="2">',htmlspecialchars($Body),'</textarea>';

    and enter your text/html code after </textarea>

    e.g. ...htmlspecialchars($Body),'</textarea><br /><p>* <strong>Note on titles</strong>: you must have a title for this article.</p>';

To change existing text on the admin page, you edit \textpattern\lang\en_gb.txt or your other language files.



Tooltips on Custom Fields
  1. Open \textpattern\lib\admin_config.php
  2. Find the custom fields bit
    // use custom fields for articles - must be in 'quotes'
  3. Add your custom text for the custom fields.
    e.g.
    'custom_2_set' => '<span title=" enter your/website URL here " class="popup"><strong>Website</strong> [?]</span>',

Article Request Count:
Posted here:
03 Mar 2005

You know you want to visit the Archives.
Published with Textpattern