DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:pagetemplate

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
Last revisionBoth sides next revision
plugin:pagetemplate [2009-01-02 20:06] 70.103.232.219plugin:pagetemplate [2023-04-20 22:18] Aleksandr
Line 1: Line 1:
 +====== pagetemplate Plugin ======
  
 +---- plugin ----
 +description: Link syntax copies existing page to new page at creation
 +author     : Luke Howson
 +email      : mail@lukehowson.com
 +type       : action, syntax
 +lastupdate : 2007-08-23
 +compatible : 2006-11-06
 +depends    :
 +conflicts  :
 +similar    :
 +tags       : !discontinued, editing, template, links, !experimental
 +
 +downloadurl: https://trello-attachments.s3.amazonaws.com/5af4815352fa15728c62aaae/5d500efcd67eaa60c57f9ed0/4f8feda2fd2588250b79a2dc0aca89ba/pagetemplate.zip
 +bugtracker : 
 +sourcerepo : 
 +
 +screenshot_img: 
 +
 +securitywarning: Plugin is installed in the directory “cache” instead of “pagetemplate”. Needs manually renaming.
 +----
 +
 +^   Version|0.2 alpha  |
 +^    Status|[[:experimental]]  |
 +^  Download|[[https://trello-attachments.s3.amazonaws.com/5af4815352fa15728c62aaae/5d500efcd67eaa60c57f9ed0/4f8feda2fd2588250b79a2dc0aca89ba/pagetemplate.zip|pagetemplate.zip]]  |
 +
 +===== Description =====
 +
 +The Pagetemplate Plugin is a new link syntax.  If the page does not yet exist, it will create the page in the normal fashion.  The new page, however, will not be empty ,but will contain the content copied from another page in the wiki.  Once the page has been created, the pagetemplate link functions like any other internal link.
 +
 +The intended purpose is to create a simple template system for semi-standard oft repeated page types.  Because the template page itself may contain further relative pagetemplate links, structures of pages can be created.
 +
 +===== Syntax =====
 +
 +  [[[newpagename?templatepagename|Display Name]]]
 +
 +Yes, those are triple square brackets.
 +
 +^newpagename|name of new page|required|
 +^templatepagename|An existing wiki page|optional|
 +^Display Name|the display name for the page|optional|
 +
 +===== Example Usage =====
 +
 +  [[[.new_plugin?templates:plugin_template|New Plugin]]] ;)
 +
 +===== Installation =====
 +
 +FIXME Wouldn't it be possible to remove the directory "cache/" from the archive.
 +
 +__Don't install in the usual way__ : the above archive sets an empty "cache" directory that leads you to a "cache" plugin that does nothing. You'd rather refer to [[plugin:pagetemplate:listing|Code Listing]] for manual installation.
 +
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
 +
 +=====  Code Listing =====
 +
 +See: [[plugin:pagetemplate:listing|Code Listing]]
 +
 +===== To Do =====
 +
 +  * Correct the archive (suppress "cache" folder)
 +  * make it work with last DokuWiki version
 +
 +===== Bugs =====
 +
 +==== Not working with version 2008-04-11 ====
 +
 +Installed fine but the given examples above show with an underline and an extra "]" to the right and when clicked try to generate a page with BOTH the new page name AND template name merged together; the resulting page is blank.
 +
 +PerryM 4/20/08
 +
 +>+1 : installations says "pluging cache installed" but the triple brackets does the same as before installing the plugin. Good idea though to offer the opportunity to let users make templates, like MediaWiki offers to make "models" --- //NewMorning 2008/08/03 12:20//
 +
 +> Actually manual install works better : triple brackets are recognized, but the template isn't loaded though... --- //[[hugoborrell@gmail.com|NewMorning]] 2008/08/07 15:01//
 +
 +> Is there any way to get this plugin working on newer versions of dokuwiki? --- //[[tezmanian@gmail.com|tezmanian]] 2011/03/28 15:44//
 +
 +===== Comments =====
 +
 +== Old wine in new bottles? ==
 +
 +Dokuwiki offers you the possibility to define templates: 
 +  * create a file called **"_template.txt"** (in UTF-8) on your hard disk, 
 +  * fill it with the necessary content and upload it in your namespace (maybe you have to put the permission to 766)
 +  * every time a file in this namespace is created, the template is loaded in the editor-menu.
 +
 +//Usage/ Example//: If you want to build a site with recipes and one of your namespaces (folders) reads "lunch". And the template "_template.txt" with the skeleton for a lunch dish was put in the lunch-folder, every time a file is created in the lunch-namespace, the _template.txt is loaded in the editor-menu, where you can fill it with data. The _template.txt itself is not changed.
 +
 +Have a try! 8-)
 +
 +**Reply:**
 +
 +Well, perhaps the bottle contains a refined pinot to the robust default cab-sauv. ;-)
 +
 +The differences from the default mechanism are:
 +  * Any existing page can become a template.  Any non-tech user can make a template on-the-fly within the wiki without needing to fool around on the server.
 +  * No namepspace restrictions. Templates can be used in all namespaces, and many different templates could be used within the same namespace.
 +  * Makes it possible to spawn a series of pages in a structure.  So if a link is created to <code>[[[jobname?templates:newjob]]]</code> the template page <newjob> may contain further template links - <code>[[[contacts?templates:newcontactpage]]], [[[timeline?templates:newtimeline]]], [[[issues?templates:newissueslist]]]
 +
 +</code> - and so on.
 + --- //[[greenboxster@gmail.com|Green Box]] 2007-08-28 03:49//
 +
 +**Reply:**
 +
 +With regards to _template.txt ... you could also symlink template.txt to it and then edit it from within the wiki.  Still requires shell interaction, but a little nicer.  It will show up in indexmenu lists though, so you could either reorder it or name the symlink ztemplate.txt or something alphabetically insignificant for you application ... or ... put all such symlinks in another directory with some sane naming scheme.   Not saying you should, it just has a few useful applications in my environment.
 + --- //[[ryan@slowest.net|Ryan]] 2008-06-12//
plugin/pagetemplate.txt · Last modified: 2023-12-21 16:17 by Aleksandr

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