Not logged in. · Lost password · Register
Forum: General Help and Support Syntax and Usage RSS
make own template to new page
Page:  previous  1  2 
Avatar
Digitalin #16
Member since Feb 2014 · 207 posts · Location: Uzès - France
Group memberships: Members
Show profile · Link to this post
In reply to post ID 65022
Hi,

you need to specify the path of your template :
action template api_caves:_template.txt api_caves:

I am used to separate templates from destination namespace and don't use namespace template with Bureaucracy but it seems possible,
as explained in the doc section template mode of bureaucracy. I really don't know the advantages to use it but the mecanism seems very close to me.
This post was edited on 2019-02-23, 08:26 by Digitalin.
Avatar
hj #17
Member since Apr 2008 · 167 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
Thanks pop and Digitalin.

Well, tried both of those remedies and unfortunately the malady persists...

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

The file is there, sure enough, sitting in the api_caves namespace directory.  Mac permissions are set to Read & Write for everyone, and as I said before, the localhost MAMP stack doesn't fuss about permissions because the Mac has given it all permissions!  Maybe I'll move everything to a live server and test it, see if that unearths anything.

I have to say I'm confused by templates;  pop, you say 'page templates' are quite another thing' - I don't understand, they're quite different from what?...and in what way are they different?

Digitalin, you say 'I am used to separate templates from destination namespace and don't use namespace template'... but they sound like exactly the same thing to me!  Do you mean you keep your templates somewhere separate and not in the namespace? 

I'm trying to create new pages using Bureaucracy. ALL the pages in the namespace (with the exception of the add_new_cave form) will use the template layout, which is a table of labelled fields - the fields are filled with the variables submitted by the form.  To me, that is a namespace template, because it's used for all pages in the namespace. But I suppose it's also a page template - it is a template for a standard page!  I fail to see the difference?

Thanks.
Avatar
Digitalin #18
Member since Feb 2014 · 207 posts · Location: Uzès - France
Group memberships: Members
Show profile · Link to this post
Digitalin, you say 'I am used to separate templates from destination namespace and don't use namespace template'... but they sound like exactly the same thing to me!  Do you mean you keep your templates somewhere separate and not in the namespace? 

Yes, I create a folder :templates to put all templates inside. Perhaps, it is not necessary to do so but in case ...

I'm trying to create new pages using Bureaucracy. ALL the pages in the namespace (with the exception of the add_new_cave form) will use the template layout, which is a table of labelled fields - the fields are filled with the variables submitted by the form.  To me, that is a namespace template, because it's used for all pages in the namespace. But I suppose it's also a page template - it is a template for a standard page!  I fail to see the difference?

Me too. As I said, the mecanism is realy close to me. pop seems to think differently, I maybe missed something important. With Bureaucracy, I don't need a _template (namespace), even for a whole namespace because I use Struct and its schema assigment mecanism . So, I use a single page as template ( and not a namespace as template, never tried this), I can't explain which usecase will be interesting. Sorry to not be more helpful on this topic.

Do you use the last release of Bureaucracy ? (I think to this issue)
Could you have a look on Apache logs ?
Avatar
hj #19
Member since Apr 2008 · 167 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
I only installed Bureaucracy yesterday, same day as I raised the forum post!  The download zip is this one...

splitbrain-dokuwiki-plugin-bureaucracy-2018-09-10-4-g58722ec

I guess it's the latest?

I'd probably like to use Struct at some point, but it's above my paygrade at the moment!  :-D   I need to get my head around templates and 'simple' plugins first, before I take on something as complex as 'structured data'  :scared:
Avatar
Digitalin #20
Member since Feb 2014 · 207 posts · Location: Uzès - France
Group memberships: Members
Show profile · Link to this post
It is a good idea to try different things with namespace templates with and apart Bureaucracy plugiin
It is a good step before playing with Struct :-)

Anything in Apache logs about the error you meet ?
Avatar
pop #21
Member since Nov 2016 · 148 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #18
Quote by Digitalin:
...pop seems to think differently,  ....

There's a mechanism called "page template" or "namespace template", depending on where you look.

You place a file called _template.txt or __template.txt into the directory holding the pages of the wiki or one of the subdirectories. The "base wiki" will use this template whenever you start a new page. The template may contain placeholders which then will be replaced when instantiating the page.

I use the term "base wiki" because this mechanism is in force by the wiki without adding any plugins.  The name _template.txt (with one or two leading underscores, depending on its scope) is given by the "base wiki" but can be overridden in the configuration (I believe).

What the bureaucracy plugin does is quite similar, but it's not invoked in the same way and the bit of software which then calls the template might even be different.

The error message which says "Maybe it doesn't exist or you have no read permissions?" merely says that the software can not access the file. It may or may not be a permission issue. In your case, I'd say the software looks in another directory or expects another file name.

Which directory (namespace) holds the page with the bureaucracy form, and where is your template located?
Avatar
hj #22
Member since Apr 2008 · 167 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
In reply to post #20
Quote by Digitalin:
Anything in Apache logs about the error you meet ?

I don't know.  I don't know what they are or where to look for them?...
Avatar
Digitalin #23
Member since Feb 2014 · 207 posts · Location: Uzès - France
Group memberships: Members
Show profile · Link to this post
I don't know.  I don't know what they are or where to look for them?...

Somewhere like Applications/MAMP/logs/apache.error.log
Avatar
Digitalin #24
Member since Feb 2014 · 207 posts · Location: Uzès - France
Group memberships: Members
Show profile · Link to this post
Quote by pop:
I use the term "base wiki" because this mechanism is in force by the wiki without adding any plugins.  The name _template.txt (with one or two leading underscores, depending on its scope) is given by the "base wiki" but can be overridden in the configuration (I believe).

What the bureaucracy plugin does is quite similar, but it's not invoked in the same way and the bit of software which then calls the template might even be different.

Thanks for your detailled answer. As I understand, Bureaucracy has its own mecanism and its template mode can use as template :
a single page
a complete namespace: (never tried)
If a _ is given as a template name, it uses the same process but just follows the configuration given (_ or __ ) in the namespace destination.  In this case no need to give a template path. (never tried either with Bureaucracy)
Avatar
hj #25
Member since Apr 2008 · 167 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
I copied the wiki onto a live server.  However, getting exactly the same error when trying to submit the form...

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

Must be something wrong with Bureaucracy plugin?....  my template (cavetemplate.txt) is in the right place with the right permissions, see screenshot attached.  Permissions are 644, but I've even tried with 755 and 777 (the kitchen sink!) and it still throws up the error.
The author has attached one file to this post:
Screen shot 2019-02-23 at 20.29.31.png 52.9 kBytes
You have no permission to open this file.
Avatar
elcro #26
Member since Feb 2019 · 9 posts · Location: Berlin, Germany
Group memberships: Members
Show profile · Link to this post
hello hello,

have you tried
api_caves:cavetemplate
... without the ".txt" as seen in the template section of the plugin?
(https://www.dokuwiki.org/plugin:bureaucracy#template_mode).

by the way: since the bureaucracy-template is really just an ordinary page of your wiki, you can edit it from within the wiki and not via ftp. i've also grouped my templates under a folder called "pagetemplates" to find them more easily.
Avatar
hj #27
Member since Apr 2008 · 167 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
Hello Elcro! thanks for your suggestion, I'll try it tomorrow.

Yes,I noticed the examples didn't use a .txt extension.  But then it didn't explicitly say you shouldn't use a .txt suffix, either - and as other site templates do seem to be required with a .txt suffix, it made sense to me that all templates would require it, unless otherwise specified.  Maybe that's something that should be mentioned in the Bureaucracy instructions....?

I'll only have one or two templates, I'm quite happy for them to live in the relative namespace directories. Why some templates can be wikipages and some can't is beyond me, just seems an unnecessary complication!
Avatar
Digitalin #28
Member since Feb 2014 · 207 posts · Location: Uzès - France
Group memberships: Members
Show profile · Link to this post
Quote by elcro:
have you tried
api_caves:cavetemplate

I haven't even seen it :-(
the .txt is not needed and causes an error
Avatar
pop #29
Member since Nov 2016 · 148 posts
Group memberships: Members
Show profile · Link to this post
In reply to post #27
Quote by hj:
...Yes,I noticed the examples didn't use a .txt extension.  But then it didn't explicitly say you shouldn't use a .txt suffix, either - and as other site templates do seem to be required with a .txt suffix, it made sense to me that all templates would require it, ....

If @elcro is right, Dokuwiki is looking for a file named cavetemplate.txt.txt which doesn't exist. That would mean that the extension of the template is the same as any other page in the wiki, and that you don't give the extension in the action line of the bureaucracy form (because it's always the same, perhaps).

Ah, and it might be wiser to learn first and criticize later. :-)
Avatar
hj #30
Member since Apr 2008 · 167 posts · Location: Lancaster, UK
Group memberships: Members
Show profile · Link to this post
elcro.... yes it works!  :-)  Thanks for the suggestion.

pop.... no criticism meant, just seeking a little clarity, that's all!  In code, precision is everything! I think it's fair to be told that a particular naming convention, which is commonly used elsewhere in dokuwiki, in this particular use causes an error!

All page and template files end up with a .txt suffix when you look at the dokuwiki data directory. It's just that in Bureaucracy it seems the code calls the template without the .txt suffix.  As Digitalin says, it's just knowing that the .txt is not needed and indeed causes an error if it is used!

Anyway, all well and working now, thanks everyone for your help. Onwards and upwards.......or or in my case possibly downwards, as I head for the murky depths of Struct!  :-D
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:  previous  1  2 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-06-24, 21:49:06 (UTC +02:00)