Last week we introduced a new feature people had been waiting for — fine-grained view permission settings for page categories. The view permission allows you to set who can view a given page category: let it be everyone, just Wikidot users, members of your site or just admins and moderators of your site.
The new option allows granting the view permission to the user who created a page. A small addition, but as you will see it opens a number of possibilities — you can now hide pages from everyone, while allowing users to create pages and view the pages they create.
Imagine a drop-box system where you want your users to leave messages as wiki pages so that you and a given user can read the page and comment on it. At the same time you want to keep the conversation hidden from other users. The new permission settings make it easy to set up.
I would like to show a small example of a system collecting feedback which works just as described. It will use 4 major Wikidot features:
- Templates and Data Forms
- Autonumbering
- Permissions
- Listing pages
We will use category feedback as a drop-box to contain all pages defining the structure, as well the actual feedback pages.
Step 1: Design a data form and a template
We will use an easy form to get things started. Let's create a page feedback:_template with the following content:
[[form]]
fields:
title:
type: static
value: "[[size 200%]]##666|Please leave your feedback!##[[/size]]"
feedback:
label: How do you like my site?
type: text
height: 5
[[/form]]
Nothing fancy so far, just one field. Now, when you try to create any page in a category, a form will appear:
Sure this needs some styling — we will get back to it. Explaining how forms work and how to design them is beyond this example, but you can look at the official documentation.
Step 2: Set autonumbering
Asking users to choose name (URL) for every page they create does not work in this case. Autonumbering to the rescue! This way you can point users to a single URL, e.g. feedback:create and the page they save will automatically get a sequential number as a name — feedback:1, feedback:2, feedback:3 etc.
Within the Site Manager you need to find Autonumbering of pages option and set the category feedback to be autonumbered.
Now you can set a single URL for creating feedback pages. Let it be feedback:create/edit/true. Whenever a user visits this page, the form automatically appears. Upon saving, the page automatically get its name and it's displayed on screen.
Step 3: Set permissions
Right now everyone could view everyone else's pages. We should dig into Permissions settings and make sure that:
- any Wikidot user can create a page,
- only the user who created the page can view it,
- the user who created the page can edit it (this is optional).
Of course admins and moderators can view the pages too.
Step 4: List all your feedback
Now let us create a simple page to list all feedback pages. ListPages module should make it easy. Let's create a page feedback:_list with content:
[[module ListPages category="feedback"]]
by: [[*user %%created_by%%]]
%%form_data{feedback}%%
[[%%link%% link]]
--------
[[/module]]
Here is how it works with a couple of my own feedbacks:
Step 5: Final refinements
The system already works! One final thing is to style the form a bit and add a "Thank you" text that should appear after the feedback page is saved.
First part is unfortunately involves editing the CSS theme for the given category. You should add the following piece of code to the theme for category feedback:
tr.row-0 {
display: none;
}
#action-area h1 {
display: none;
}
#page-title {
display: none;
}
If your site originates from the default template, the easiest thing to do is to create a new custom theme (under Custom Themes in Site Manager) like this:
and apply it to the feedback category:
Now for the "Thank you" text. The change is easy and involves editing the feedback:_template page:
= [[size 250%]]Thanks for leaving your feedback![[/size]]
= [[size 150%]][/ Back to the main page][[/size]]
====
[[form]]
fields:
title:
type: static
value: "[[size 200%]]##666|Please leave your feedback!##[[/size]]"
feedback:
label: How do you like my site?
type: text
height: 5
[[/form]]
We could also display the data from the feedback page, but this is up to you now.
Rather than seeing another screenshot, why don't you just take a look how it works live:
Wikidot already had powerful tools to build application-like websites. In the example above, the key elements have been used to create a really simple, but extendible feedback system, where the new permission settings play a critical role.
The above system could be easily adapted to handle various contact forms or even support requests from customers if you also enable page comments.
If you find the above example useful and decide to implement a similar system on your site, please let us now by adding your comment here!
But I detect now - I have no chance to see the "other" feedback of other users… !
Is this now bad or good?
(I know this is the target of this system with the view permissions .:)
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
yeh this work fine without problem
I would add on the test site (feedback) the possibility to see the list of feedbacks I as a user have send to the site… now it disapears into the blackbox of the site. There is no way to see anything there.
It does not even show the "new" feature of "view to only the creator".
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
Yes, you should key in this a s a feedback on the site…- or have you done this?
:)
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Actually we wanted to create an example where you cannot see other entries, so that you can set up a "secure" drop-box.
OK, so here is the modification: I have added the view permission for members of the site. If you want to see the protected pages, go to http://feedback-example.wikidot.com and simply click "Join" — you will be able to see all the pages we have created, as well as all feedback entries.
Michał Frąckowiak @ Wikidot Inc.
Visit my blog at michalf.me
I added a page to the feedback-example site to illustrate the shortcoming of this feature. Have a look at
http://feedback-example.wikidot.com/test
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
Steven, it can be done via URL, like it is done here.
Notice that the link in the sidebar to that page automatically includes your username.
Also note that if you attempt to view the 'status' page directly without providing a created_by value, it will redirect to a URL that *does* include your name.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Okay, this is great… it works HOWEVER!!!
It was a drag to adjust your code, for me it was not such a big problem but this would be the VERY COMPLEX sixth step (following the five easy ones)
So I would sill suggest more wikidot functionality for the listusers module to make a redirect module inside a listusers module possible.
Check out the result at http://feedback-example.wikidot.com/yourfeedbackredirect/
A - S I M P L E - P L A N by ARTiZEN a startingpoint for simple wikidot solutions.
Actually, tsangk wrote that. I just linked to his awesome solution.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
hey this great post..thanks for sharing!!
Ok
Lic. Isaac Fermin