What is sLink?
sLink (pronounced: es-link) is a simple snippet for MODx Revolution which can help create the xhtml markup for links or anchors from paramaters. sLink was first released on October 21st, 2010 and was created by Mark Hamstra.
sLink was created as a Revolution snippet, and should function on all versions since 2.0.0. If you notice inconsistencies in certain versions, please inform the developer on the forum topic.
||October 21st, 2010
||October 21st, 2010
||Fixes resource->get() error when using regular links instead of a resource
Download & Installation
To get started using the sLink snippet, simply go to System -> Package Manager -> Add new extra -> provider: modxcms.com -> MODx add-ons -> Content and find sLink. Download the package, and install it in the main package manager workspace.
Alternatively, you can download the transport package from the repository, upload it to your server in the core/packages folder and install through the workspace.
sLink is an easy to use snippet which can be used in a few different ways using the parameters.
||Required. This parameter describes where the link points to, either a resource id or regular url.
||(int) doc id | (string) url/anchor
||Optional. Same as &title except this parameter describes the link text.
||Optional. Can be used to create an in-page anchor.
||(string) the anchor
||Optional. Can be used to add a css class to the link.
||(string) the css class(es)
||Optional. Used to debug your snippet call if needed. Debug levels:
0: off (if there's an error, nothing will be shown on the page)
1: on, will only show the amount of errors encountered
2: advanced, shows the errors as well as the parameter values that were calculated. If no errors are found, this outputs nothing.
|(int) 0, 1 or 2
Minimum call which gets the menutitle of resource 5 for the link text, and the longtitle for the title (hover) text.
Minimum call for external links, with link and title text set in the snippet call.
[[sLink? &to=`http://rtfm.modx.com` &title=`Please, read that manual!` &link=`RTFM`]]
Calling sLink to create an anchor within your page.
[[sLink? &to=`#myAnchor` &name=`myAnchor` &link=`This is an anchor` &title=`Clicking me focuses your screen`]]
sLink is not actively being developed at this point. Others are encouraged to "borrow" the code in their own projects or pick up development for this addon.
Forum topic for sLink 1.0-rc1: http://modxcms.com/forums/index.php/topic,56101.0.html
Repository page: http://modxcms.com/extras/package/741