Page 1 of 1

New staticpage feature: Show staticpages via Smarty

Posted: Wed Jun 13, 2007 12:36 pm
by garvinhicking

I just upgraded the staticpage plugin in CVS to version 3.50.

It now supports to use a custom smarty function to show static pages. This can be used in your custom template files (like the userprofile .tpls) to emit specific staticpages depending on variables.

Go ahead and play with it. The API is quite basic and described in the new '' file. It basically works like this:

// {staticpage_display template="$TEMPLATE" pagevar="$PAGEVAR" id="$ID" permalink="$PERMALINK" pagetitle="$PAGETITLE" authorid="$AUTHORID" query="$QUERY"}
// Variable options:
// $TEMPLATE can be replaced with the name of the staticpage template to parse. It defaults to "plugin_staticpage.tpl".
// $PAGEVAR must match the variable prefix of the staticpage template. If you want to parse multiple staticpages,
// you might need to seperate those from each other. Always use the variable prefix that is also employed in the template file.
// To retrieve a staticpage, you need to supply either one of those options:
// $ID can be replaced with the ID of the staticpage you want to fetch.
// $PERMALINK can be replaced with the fully configured permalink of a staticpage.
// $PAGETITLE can be replaced with the URL shorthand/backwards compatibility name of a staticpage
// $AUTHORID additionally can be combined with the variables above to restrict output to a specific author
// If you need more customization, you can pass a SQL query directly using $QUERY.
// To fetch a static page with the URL shorthand name 'static' you simply put this in your template file (index.tpl, a userprofile .tpl or whatever):
// {staticpage_display pagetitle='static'}

The API is quite fundamanetal right now. If you want to access more properties/parameters, please let me know, and I'll implement them.