Content last modified Monday 6 March 2017
hop to #bottom
Categories:
Author:
Current version:
0.3
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!

chh_admin_tags

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.

chh_edit_article

    <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.

chh_admin_off

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.

chh_if_admin

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


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

    <txp:chh_edit_style wraptag="li" />
    </ul>
    </txp:chh_if_admin>

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:


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

    </txp:chh_if_admin>
or
    <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.

Download

The current version is 0.3.

Article Request Count:
Initially released:
2004-06
Posted here:
29 Aug 2005

If there is a comment form at the Information URL, you may want to leave your comments/questions there for quicker feedback. Otherwise, comment away:

Your comment will NOT be submitted until you click the 'Submit' button on the next pageload.

Commented (1)

This was definitely a very important feature missing, thanks a lot for this :-)

Subscribe to this article's comments RSS feed. [ ? ]   View Recent Comments across the site.

You know you want to visit the Archives.

Browse

Categories


Articles

There are also tag clouds, 'cause those are fun.
Published with Textpattern