Comparing versions
Version 2Current version
Input:
- ititle (required) words that are displayed
- ianchor (optional) set the anchor where the link should point to
- isort (optional) name of the sort column without the orientation (e.g.: title)
- isort_mode(optional) this can be used to manually pass the sort mode to smartlink
overrides the value given in $_REQUESTsort_mode>'sort_mode', which is the default
- iorder (optional) if set to asc or desc, it sets the default sorting order of this particular column

asc is default
- idefault (optional) if set, it will highlight this link if no $isort_mode is given
this should only be set once per sorting group since it represents the default sorting column

- itype (optional) can be set to
url --> outputs only url
li --> outputs link as <li><a ... ></li>
- ionclick (optional) pass in any actions that should occur onclick
- ibiticon (optional) if you want to display an icon instead of text use ibiticon
format is: '<ipackage>/<iname>'
e.g.: 'liberty/edit'
- iurl (optional) pass in a full url
- ifile (optional) set the file where the link should point (default is the current file)
- ipackage (optional) set the package the link should point to (default is the current package)
- * (optional) anything else that gets added to the pile of items is appended using &$key=$val
- ihash (optional) you can pass in all the above as an array called ihash or secondary * items common to all links
Output: any kind of link. especially useful when it comes to links used to sort a table, due to the simplified syntax and loss of cumbersome if clauses
also useful if the you want to display an icon as link since smartlink takes biticon parameters
Example - {smartlink ititle="Page Name" isort="title"}
- {smartlink ititle="Page Name" isort="title" iorder="desc" idefault=1}
setting iorder and idefault here, makes this link sort in a descending order by default (iorder)
and it is highlighted when $isort_mode ( or $_REQUESTsort_mode>'sort_mode' ) is not set (idefault)
Note Don't use this plugin if ititle is generated dynamically since it is passed through tra()
 
Outputs any kind of link. Especially useful when it comes to links used to sort a table, due to the simplified syntax and loss of cumbersome if clauses also useful if the you want to display an icon as link since smartlink takes biticon parameters.

Output: any kind of link. Especially useful when it comes to links used to sort a table, due to the simplified syntax and loss of cumbersome if clauses. Also useful if the you want to display an icon as link since smartlink takes biticon parameters

Note Don't use this plugin if ititle is generated dynamically since it is passed through tra()


Parameters

ititlewords that are displayedrequired
ianchorset the anchor where the link should point tooptional
isortname of the sort column without the orientation (e.g.: title)optional
isort_modethis can be used to manually pass the sort mode to smartlink. overrides the value given in $_REQUEST['sort_mode']], which is the defaultoptional
iorderif set to asc or desc, it sets the default sorting order of this particular column. 'asc' is defaultoptional
idefaultif set, it will highlight this link if no $isort_mode is given. this should only be set once per sorting group since it represents the default sorting columnoptional
itypecan be set to 'url', which will output only the url, or 'li', which will output <li><a ... ></li>optional
ionclickpass in any actions that should occur onclickoptional
ibiticonif you want to display an icon instead of text use ibiticon. format is: '<ipackage>/<iname>[/iexplain]]' e.g.: 'liberty/edit'. This will be resolved by biticon, so you might want to know about that function as well.optional
iurlpass in a full urloptional
ifileset the file where the link should point (default is the current file)optional
ipackageset the package the link should point to (default is the current package)optional
ihashyou can pass in all the above as an array called ihash or secondary * items common to all linksoptional
*anything else that gets added to the pile of items is appended using &$key=$valoptional


Sample

This sample creates a simple link with sorting functionality:

<?php
{smartlink ititle="Page Name" isort="title"}
?>

This sample also takes care of the current position within the list (offset):

<?php
{smartlink ititle="Title" isort=title offset=$control.offset}
?>

setting iorder and idefault here, makes this link sort in a descending order by default (iorder) and it is highlighted when $isort_mode ( or $_REQUESTsort_mode>'sort_mode' ) is not set (idefault)

<?php
{smartlink ititle="Page Name" isort="title" iorder="desc" idefault=1}
?>


See also

Page History
Date/CommentUserIPVersion
16 Jan 2007 (13:43 UTC)
hiran85.233.40.1927
Current • Source
hiran85.233.40.1926
View • Compare • Difference • Source
hiran85.233.40.1925
View • Compare • Difference • Source
hiran85.233.40.1924
View • Compare • Difference • Source
hiran85.233.40.1923
View • Compare • Difference • Source
Lester Caine81.138.11.1362
View • Compare • Difference • Source
Lester Caine81.138.11.1361
View • Compare • Difference • Source