Tokens

Tokens are written into the post content as regular text in double square brackets like this [[token name]]. Some tokens accept options like this [[token name|option string]]. bSuite Core includes a few default tokens:

Built-In Tokens

date

Inserts the date, uses the same options as PHP’s date function.
Examples:

  • [[date]]
  • [[date|F j, Y, g:i a]]

pagemenu

Inserts a list of Pages. Wrap it with ol or ul tags to make it valid.
The options are the same as those supported by wp_list_pages, the default (when called without any options) will output a list of child pages of the current page (child_of=$id&depth=1) sorted by menu order (sort_column=menu_order).
Examples:

  • []
  • []

innerindex

Inserts a div with a linked list of anchors in the current page. Anchors are automatically added to any H-tagged text. See it in action at the top of this page.
Example:

feed

Inserts the content of an RSS/Atom feed into the body of the post. The template can include any valid HTML, %%link%% , %%title%% , and %%content%% will be replaced with elements from the feed.
Examples:

  • []
  • []

redirect

If headers haven’t already been sent to the browser, this will send a redirect to the location specified, otherwise it just inserts a link in the content.
Examples:

  • [[redirect|http://maisonbisson.com/]]

Extending Tokens

Other WordPress plugins can add their own tokens using the bsuite_tokens filter. The bSuite Slideshow plugin is offered as an example.

6 Comments

  1. Posted November 27, 2007 at 5:03 pm | Permalink

    Hi,

    I just downloaded the plug-in. Thanx for the good work. I’m experimenting with [[innerindex]]-token, i.e. on

    http://www.malescribir.de/trayectorias/ilegibilidad-en-latinoamerica

    Looks ok, but “Contents” is too large and besides, in Englisch. How and where can I make it smaller and translate it default into spanish (=Contenido)?

    Thanx for your advice and greetings from Berlin,

    T.

  2. Posted November 27, 2007 at 7:38 pm | Permalink

    Hi again!

    one more thing: the token doesn’t take up h1, h2, etc., when they have an italic included. Tried it with different tags (, ), but didn’t work.

    Can you include that feature with your next update? That would be great!

    T.

  3. Posted November 28, 2007 at 12:53 pm | Permalink

    @tobias:

    you can use whatever title you want with this undocumented trick:

    [[ innerindex | THE_TITLE ]]

    You can change the size and position of the innerindex block and heading using CSS. Look for div class=”innerindex”

  4. Posted February 14, 2008 at 4:01 pm | Permalink

    once i try to turn on the plugin i got this error:

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /web/htdocs/www.vaigotti.com/home/tzenosphere/wp-content/plugins/bsuite/core.php on line 249

    why?

    wordpress 2.3.1

    thanks!
    mate

  5. Posted April 3, 2008 at 7:22 am | Permalink

    I also get this error when I activate the plugin…

    Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ?}? in /web/htdocs/www.vaigotti.com/home/tzenosphere/wp-content/plugins/bsuite/core.php on line 249

    I used Wordpress 2.3.2 then tried it on Wordpress 2.5. I get the same error.

    Can anyone help? Thanks.

  6. Posted April 28, 2008 at 6:14 am | Permalink

    I get the same error as Dave Q. My MySQL is 5.0 but is it possible is should be 5.1?

One Trackback/Pingback

  1. [...] post of page content that get replaced with the results of a PHP function. A number of tokens are built in, but they’re extendable; bSuite Slideshow offers one example of how another plugin could [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*