Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
make own template to new page
Page:  1  2  next 
Avatar
krisped #1
Member since Sep 2016 · 15 posts
Group memberships: Members
Show profile · Link to this post
Subject: make own template to new page
Hi!

i am going to add 20 sub pages to my wiki.
the pages should be similar , except some small things.
is there a way so i can use the first page as a template for the rest , and still have the opportunity to change the name and etc. ?

kris
Avatar
MartinR #2
Member since Jul 2015 · 153 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
Quick and dirty approach:

1) Open up the first page in tab 1 in your browser.  Go into edit.
2) Open up the other pages in tabs 2-20, create which will dump you in edit mode.
3) Select and copy the whole of tab 1.
4) Paste into tabs 2-20
5) Close tab 1 (for safety).
6) Edit the name, preview and save for each of tabs 2-20.
Avatar
Digitalin #3
Member since Feb 2014 · 212 posts · Location: Uzès - France
Group memberships: Members
Show profile · Link to this post
or use a great feature of DokuWiki : the namespace template and with the TemplatePageName plugin, you can even edit these special pages as wiki pages :-)
Avatar
SFITCS #4
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
In reply to post #1
You probably don't need to open 20 tabs - and, more importantly, templates are redundant when the pages already exist. I'd suggest you take a quick look at name space template replacement patterns (you'll find you probably don't have to "create" names - just pre-existing links in your sidebar or such), and maybe also the plugin that Digitalin suggests.

i.e. if you have a namespace called :test and either a _template.txt in that namespace ($DokuWiki/data/pages/test) or a __template.txt in the directory above it ($DokuWiki/data/pages), the template will be used as the basis for a new page.

I've attached an example template. Note that it may call some plugins you don't use.
The author has attached one file to this post:
_template.txt 1.5 kBytes
You have no permission to open this file.
Avatar
krisped #5
Member since Sep 2016 · 15 posts
Group memberships: Members
Show profile · Link to this post
thanks guys!

but is there a way that i can make a template that can contain fields to fill in ?
i would like to have a template that can create some fields to insert info to specific lines in the template.

e.x to fill in

- name
- contact info
- phone number etc

i have installed https://www.dokuwiki.org/plugin:addnewpage and https://www.dokuwiki.org/plugin:newpagetemplate .
but i cant get it to work.
i get the new page field when i add {{NEWPAGE}} , and then i add a name , but when i hit the "add page" button , i get directed to my home page ? :S
Avatar
SFITCS #6
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
Quote by krisped:
is there a way that i can make a template that can contain fields to fill in ?
Yes. You can (judicisously) use htmlok and embed a html form in the template - or perhaps the Bureaucracy plugin (I could provide a better answer than perhaps, if you supplied your usecase specifics).
i have installed https://www.dokuwiki.org/plugin:addnewpage and https://www.dokuwiki.org/plugin:newpagetemplate .
but i cant get it to work.
i get the new page field when i add {{NEWPAGE}} , and then i add a name , but when i hit the "add page" button , i get directed to my home page ? :S
Your problem baffles me too!
:)
:D
I suspect it would be a lot less baffling if you described all of what you are trying to do...

It might be that what you want to do is best suited to Bureaucracy - it can use forms and template/s you design to produce (in this case) a new page with content from the data entered into the form, and content (and structure) dictated by the template/s. If you want to produce slightly different pages -  "20 times"!

It's also likely what you want to do should be done with a script (which is outside the scope of this forum). If you only want to produce "20" slightly different pages - "now"!

If you supply an abbreviated example of the basic page you want to produce, and mark the places it varies, and provide a small sample list of the variations - forum readers may be able to make a better suggestion.

[gently] While you may know exactly what you want to do - it's not clear to me what you want to achieve (I can be a bit thick), more explanation may result in an answer using less posts :)
Avatar
krisped #7
Member since Sep 2016 · 15 posts
Group memberships: Members
Show profile · Link to this post
Sorry SFITC , a bit quick in the last post.
thanks for trying :P

but i will try to explain my self a bit deeper this time.

So , my gole is to a achieve the following :

My clients are abel to create there own page , by filling out a form.
by typing in the customer name i a box called e.x "Cust name" - it generate a subpage under the namespace :customer:"cust name"

by filling in the rest of the text boxes , like adresse , contact person and so on , the form is then creating the new page.

i have looked in to the following plugins to archive this.
 - Bureaucracy Plugin , like you told me. ( thanks btw!)
- pagemod Plugin , to create the new page.

please notify me if you need some more info!
Avatar
SFITCS #8
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
Thanks for providing the additional detail.

The solution is simple - you only need the Bureaucracy plugin and a template for it. But you can do more if you want :)

Create a new page and put a Bureaucracy form in it that generates a new page using the template you create.
New users enter the information into the form, press the button and a new page will be generated populated with their details and whatever additional information you've put in the template.

I usually keep all Bureaucracy templates in data/page/templates, which is only accessible by admin (and not shown in search, sitemap or other lists).

I've attached two DokuWiki pages and two templates in a .zip file to this post which you might possibly find useful as the basis of your solution. Note that: the templates probably use plugins you don't have (or want); the form uses one of two templates depending on what is selected in the initial form (you probably only want to use one template); my examples are specific to Australia; I've hacked my copy of Bureaucracy to change the actions of Thanks - it's probably a bad idea to do the same thing; there is probably other stuff I haven't thought of.

  * The new_client page which contains the Bureaucracy form for creating new client records lives in :
  * The start page lives in :clients and uses the Structured Data plugin to display information about Clients
  * All created client pages live in :clients:$Client_Name
  * chkbx is a macro in /conf/entities.local.conf - you'd need htmlok enabled in your configuration and should consider the security implications of using that configuration.
chkbx    <html><input type="checkbox"></html>


AlphaIndex which automagically creates an index of pages (in this case Clients, you'd probably use Customers), and the Do plugin.

HTH
The author has attached one file to this post:
Bureacracy_example.zip 2.9 kBytes
You have no permission to open this file.
Avatar
krisped #9
Member since Sep 2016 · 15 posts
Group memberships: Members
Show profile · Link to this post
thanks!

but how do i make a Bureaucracy template ?
i got the boxes to work , but i cant get the template to work..
how to i add a template to the folder ?
do i use a plain text doc as an template ?
Avatar
SFITCS #10
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
Quote by krisped:
but how do i make a Bureaucracy template ?
With an appropriate text editor. If that's not a useful answer please consider supplying more, useful, information (:) my psychic powers don't tell me what operating system you are working with, what OS your webserver is running, and a host of other pertinent information)
Quote by krisped:
i got the boxes to work , but i cant get the template to work..
Some more detail besides "it didn't work" might result in a useful answer. Where is the form page? Where does it expect the template to be? Where is the template? Where has all the time gone?
Quote by krisped:
how to i add a template to the folder ?
I could guess that you are using Windows from the use of the term "folder"... but guesses are rarely useful.
Quote by krisped:
do i use a plain text doc as an template ?
By "doc" do you mean Microsoft Word?? If so, no.

Did you look at the templates I supplied?

[gently] I suggest that you:- setup the examples I gave you, in the locations I described in detail. The answers to all your questions might then become obvious, if not - please read the fine documentation that Andi has written on the plugin page, if your question is still not answered search this forum, if, after that you still have questions please supply lots of detail about what you are doing/have done/the Operating system you do your work on/your webserver and how you access it.
Avatar
molefunk #11
User title: molefunk
Member since Jul 2010 · 54 posts · Location: Mayapur, India
Group memberships: Members
Show profile · Link to this post
In reply to post #4
Quote by SFITCS on 2016-09-29, 16:07:
I've attached an example template. Note that it may call some plugins you don't use.
Looking at the example template, I'm just thinking that it might be better to use the Comment plugin than hiding with a wrap, as wrap is only hidden via CSS. Apart from that, good example!
Avatar
SFITCS #12
User title: Scott Ferguson
Member since Dec 2014 · 464 posts · Location: Canberra, Australia
Group memberships: Members
Show profile · Link to this post
Thanks for the suggestion (and the compliment).
I find the Comment plugin great, and tend to use it more in other templates - in this case it was one of the first templates I created, and the only people who have access to that DokuWiki are administrators who are fairly proficient with DokuWiki (it's also only accessible on my intranet).
I have considered making the whole DokuWiki structure available as an example for those who have trouble with Bureaucracy and Structured Data, and as a basis for those that would like the functionality to manage their own business. There are also Change Control, Data Dictionary, Jobs, Bookkeeping, Invoicing, Project Management, Ticketing, and other functions I've built into it (much inspired by IckeWiki).
~Scott
Avatar
MartinR #13
Member since Jul 2015 · 153 posts · Location: UK
Group memberships: Members
Show profile · Link to this post
Molefunk, SFITCS, - you might also want to look at  https://www.dokuwiki.org/plugin:htmlcomment as yet another option.
Avatar
hj #14
Member since Apr 2008 · 173 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
Roll on a couple of years.....

I found this thread via google and read it with interest as I'm trying to do something similar in my wiki.  Basically I'm trying to use the Bureaucracy plugin to create new pages (or records).
1. I've coded the Bureaucracy form in a page called add_new_cave
2. I've created a template with @@placeholders@@ to display the form contents
3. I've coded the Bureucracy form to 'action' the form to template....with the following code line:

action   template _template.txt api_caves:

All seems good, I fill my form and click the submit button.....and get an error message:

Could not read template "api_caves:template.txt". Maybe it doesn't exist or you have no read permissions?

This seems a bit odd as I'm working on a MAMP localhost stack where permissions aren't needed - they've never been needed in Dokuwiki, nor in Wordpress which I work in. Sure, on a live server I'd be CHMODing (if it was necessary).

I've tried to follow the Bureaucracy instructions, but maybe I'm missing something only the trained eye can see.  any trained eyes out there?

A few screenshots/files attached to help.

Many thanks
The author has attached one file to this post:
doku-caves.zip 161.9 kBytes
You have no permission to open this file.
Avatar
pop #15
Member since Nov 2016 · 175 posts
Group memberships: Members
Show profile · Link to this post
I have not analyzed the problem in depth, but I would question the use of the underscore at the beginning of the template name. Try using a template name which does not begin with an underscore.

Actually, I believe that the name "_template.txt" ought to be used for page templates which are quite another thing and has nothing to do with bureaucracy.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  next 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-09-17, 08:42:51 (UTC +02:00)