This plugin is a collection of some additional template variables and is intended as a framework for adding others.
I have started with some replacements for <%itemlink%>, <%categorylink%>, and <%authorlink%>, all of which give links with the current page's blog as the base url. This causes some trouble for users with multiple blogs who use the <%otherblog%> skinvar. <%TempVars%> in its forms use the current item's blog url for the base of its links, so links take the user to the correct blog for an item, member, or category.
| General Plugin info | |
|---|---|
| Author: | Frank Truscott |
| Current Version: | 0.5 |
| Code: | NP_TempVars_code |
| Forum Thread: | http://forum.nucleuscms.org/viewtopic.php?t=12310 |
Add the appropriate form of the plugin in your templates. The general form is as follows.
<%TempVars($action, $param1, $param2, $param3,…)%>
where $action is one of blogsetting, permalink, itemlink, icategory, category, iauthor, author, smartmore, userwebsitelink, usermaillink, iscurrentitem
<%TempVars(blogsetting,type,blogname)%>
where type is one of id, name, desc, short, url and blogname is a blog's shortname (optional)
This is like the blogsetting skinvar, but chooses blog item belongs to not the blog of the displaying page. Replaces <%blogurl%>, <%blogid%>
<%TempVars(permalink,includeblog,includecat)%>
where
includeblog is whether to include blog specifier in link, yes or no, default is yes. (optional) includecat is whether to include category specifier in link, yes or no, default is yes. (optional)
This gives a link to item using the item's blog url and catid as specified. Replaces <%itemlink%>
<%TempVars(itemlink,includeblog,includecat)%>
synonym of permalink
<%TempVars(icategory, type)%>
where type is one of url, link, id, desc, name
displays info about item's category, but url and link use item's blog url as base instead of calling page Replaces <%categorylink%>, <%category%>
<%TempVars(category, type)%>
synonym of icategory
<%TempVars(iauthor, type)%>
where type is one of realname, link, id, email, url, name
displays info about item's author. link gives link to member area of item's blog, not the calling page. url gives the member's home site url. Replaces <%authorlink%>, <%author%>, <%authorid%>
<%TempVars(author, type)%>
synonym of iauthor
<%TempVars(smartmore)%>
This is the opposite of smartbody (if there is an extended, it is displayed, otherwise it displays the body). Use on item pages to show only the extended part if it exists. This let's you use the body of the item for a synopsis to show on main pages and the extended on the item pages.
<%TempVars(userwebsitelink)%>
This is a comment template var. Displays a link to the comment author's web site if given, otherwise just displays the name. Does not display email addresses.
<%TempVars(useremaillink)%>
This is a comment template var. Displays a link to the comment author's email address, if given, otherwise just displays the name. Does not display website addresses.
<%TempVars(iscurrentitem)%>
This is an item template var. Outputs 'yes' if viewing the current item and no if not. Useful to use css class to highlight current item in a list in menu or sidebar.