Content last modified Tuesday 24 August 2021
hop to #bottom
Current version:
About It:
Get 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!


The chh_admin_tags plugin offers several quick links for “front-end” editing of article content, page templates, and style sheets; the chh_if_admin tag allows content to be displayed only to users who are logged in as Textpattern administrators.


    <txp:chh_edit_article />

This tag creates a link labelled “Edit Article”, that links directly to the Textpattern content/write tab for that article. It supports the standard Textpattern-style wraptag attribute. Any additional attributes will be passed directly to the XHTML tag for easy setting of title, class, id, or other attributes. You can also specify your own link label by using the container form of the tag:

    <txp:chh_edit_article class="admin">
    Fix your typos!
    <txp:chh_edit_article />

chh_edit_article can be included in article/article-list forms or directly in page templates. In the latter case, the link will only appear on individual article pages.

chh_edit_page & chh_edit_style

These tags function like chh_edit_article, but link to the Textpattern presentation tab for the current page’s template editor and stylesheet editor respectively.


Clicking the ‘Admin Off’ link generated by this tag changes the chh_admin_tags plugin’s Active status to ‘No’, disabling the plugin. It takes the same attributes as the rest of the chh_admin_tags.


This container tag returns its enclosed text only if the remote user is logged in as a Textpattern administrator (of any level).

    <h3>Admin menu</h3>
    <txp:chh_edit_article wraptag="li" />
    <txp:chh_edit_page wraptag="li" />

    <txp:chh_edit_style wraptag="li" />

Because of the way Textpattern parses tags, chh_edit_article can’t work inside chh_if_admin tags when used in an article list form. Consequently, I had to make chh_edit_article always behave as if it is enclosed in chh_if_admin tags, and consistency dictates that all of the chh_admin_tags function similarly. So both of the following are equivalent:

    <p><txp:chh_edit_article /></p>
    <p><txp:chh_edit_page /></p>
    <p><txp:chh_edit_style /></p>

    <txp:chh_edit_article wraptag="p" />
    <txp:chh_edit_page wraptag="p" />
    <txp:chh_edit_style wraptag="p" />

Note: There are two ways to enable chh_if_admin functionality: either modify Textpattern’s cookie code by replacing txp_auth.php with the included chh_txp_auth.php file, or use the chh_admin_cookie.php file to set/unset an admin cookie. Detailed installation instructions are included in the package’s README.txt file.


The current version is 0.3.

Article Request Count:
Initially released:
Posted here:
29 Aug 2005

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