DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:varlinks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:varlinks [2016-07-24 17:23] Erandelaxplugin:varlinks [2017-04-04 02:26] (current) – removed erandelax
Line 1: Line 1:
-====== Variable Links Plugin ====== 
  
----- plugin ---- 
-description: Adds an alternative links syntax allowing dynamic variables passing. 
-author     : Erandelax 
-email      : erandelax@gmail.com 
-type       : syntax 
-lastupdate : 2016-07-24 
-compatible : 2016-06-26a "Elenor of Tsort" 
-depends    :  
-conflicts  
-similar    : var, linkway 
-tags       : !newbie, links, date, email, users, macro, page, navigation 
- 
-downloadurl: https://github.com/Erandelax/dokuwiki-plugins/archive/master/varlinks.tar.gz 
-bugtracker : https://github.com/Erandelax/dokuwiki-plugins/issues 
-sourcerepo : https://github.com/Erandelax/dokuwiki-plugins/tree/master/varlinks 
----- 
- 
-:!: **Warning!** Newbie creation. Working. Limited. Non-stable. 
- 
-===== Installation ===== 
- 
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually. 
- 
-===== Examples/Usage ===== 
- 
-Let's suppose, the page was created by the user ''One'', while the user ''Two'' is reading it after construction. 
- 
-User ''One'' writes in the page code: 
- 
-  [<private:@USER@:$USER$:message|Hey, write me!>] 
- 
-User ''Two'' reads it few moments later, he clicks a mentioned link, which leads him to ''privat:One:Two:Message'', just like if it was [[private:One:Two|Hey, write me!]]: 
- 
-  [[private:One:Two:message|Hey, write me!]] 
- 
-Something like that... 
- 
-===== Syntax ===== 
- 
-  [<link|title&params>] 
-  [<link|title>] 
-  [<link&params>] 
-  [<link>] 
- 
-Here ''%%title%%'' is text title of the link (can be absent as well). I am a very newbie, so currently I'm just trying to understand how to detect which type of content is in title (any help?:)... So for now it can feed **text titles only**. 
- 
-''%%params%%'' can be ''%%nocache%%'' (may be there should some more params later) in order to enforce wiki **not to cache** the page with this link. 
- 
-And, finally, ''%%link%%'' is an internal page link or external link (type detection is still... much rude). The main feature of the plugin is that ''%%link%%'' may contain variables from the table below (yeah, cut from [[:plugin:var]]). 
- 
-''%%@variables@%%'' are set during page editing, so if you write ''%%@USER@%%'', that means there will be your user ID in a link when the page is read. 
- 
-''%%$variables$%%'' are set during page view, so if you write ''%%$USER$%%'', that means there will be **viewing** user ID in the link when the page is read. 
- 
-Also, you can set non-standard ''%%$%%''-variables like ''%%$hello$%%'' to the link. By default, it will be replaced with its text part (''hello'' for ''%%$hello$%%''), but if you feed your page with POST/GET ''hello=someValue'', there will be ''someValue'' in the link instead. 
- 
-:!: **Warning!** Disabling cache is slowing down the page load. And for now I've not balanced yet all the situations when it is really needed, so... Yeah, it loves disabling your page caching) 
- 
-^ @ID@, $ID$    | full ID of the page                          | 
-^ @NS@, $NS$    | namespace of the page                        | 
-^ @PAGE@, $PAGE$  | page name (ID without namespace and underscores replaced by spaces) | 
-^ @USER@, $USER$  | ID of current user                           | 
-^ @NAME@, $NAME$  | full name of current user                    | 
-^ @MAIL@, $MAIL$  | mail address of current user                 | 
-^ @DATE@, $DATE$  | current date                                 | 
-^ @YEAR@, $YEAR$  | current year in YYYY format                  | 
-^ @MONTH@, $MONTH$ | current month in MM format                   | 
-^ @DAY@, $DAY$   | current day in DD format                     | 
-^ @TITLE@, $TITLE$ | first heading of the current page            | 
-^ @WIKI@, $WIKI$  | title of the wikis as configured in [[config:title]] | 
-^ @SERVER@, $SERVER$ | the content of ''$_SERVER['SERVER_NAME']'' 
- 
-=== ToDo/Wish List === 
-  * Images in ''%%title%%'' field support 
-  * More ''%%[[links]]%%''-like syntax 
-  * Link inline conditions 
-  * Code washing 
-  * Cache disabler balancing 
- 
-===== Discussion ===== 
- 
-Actually, I am in the very beginning of both DokuWiki and PHP at all, so... code works, but it is still awful and here is a lot of work to do. God, this thing is composed of other plugin' pieces... So... Any help is appreciated. 
- 
-I haven't managed to find acceptable analogs for this, so had to make this one (for my own usage at least). If you know the one, plz, mail to stop me from the time wasting :) 
- 
----- 
plugin/varlinks.1469373815.txt.gz · Last modified: 2016-07-24 17:23 by Erandelax

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki