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.

7 Comments

  1. Pingback by » bSuite 3 Released on November 26, 2007 12:45 pm

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

  2. Comment by Tobias on November 27, 2007 5:03 pm

    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.

  3. Comment by Tobias on November 27, 2007 7:38 pm

    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.

  4. Comment by Casey on November 28, 2007 12:53 pm

    @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”

  5. Comment by matteo on February 14, 2008 4:01 pm

    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

  6. Comment by Dave Q on April 3, 2008 7:22 am

    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.

  7. Comment by Thor on April 28, 2008 6:14 am

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

Comments RSS TrackBack Identifier URI

Leave a comment