Loading...
 
Features / Usability

Features / Usability


How to use "Contact us" feature? Activated - and now?

posts: 55

Hi @Jonny Bradley,

I am new to tikiwiki and completely overwhelmed by this feature called "Trackers"... I am a software developer, but without any kind of example or even an overview of what this is, it is REALLY hard for a newbie to understand, what's going on.

After having written all this below, I feel like adding an explanation: I really appreciate your help and the work of the tikiwiki team. But it seems like tikiwiki desperately needs a good documentation. If the learning curve is as steep as it just seems to me, it is unlikely to someone new to learn all this. It takes a lot of effort to do so. I know that sometimes it is hard to explain something one understands to someone who has no glimpse of it. But if a great software has no or no good documentation, then it is unlikely for anybody to learn it and hence nearly nobody uses it, which dooms the whole project. I understand that this is free and this may be the price I have to pay for this. Nevertheless, I would love to help with documentation. But for this, I first have to learn it myself. Please help me with that. I need some seriously basic information to get started.

Please understand where I am standing:

-I am completely new to tikiwiki.
-I want a simple mailform.
-I know how easy this is in html and php.

Now you tell me, in tikiwiki I need a Tracker for this. You gave me a link to the documentation (I guess), which is very welcome. Now I find this:

-An introduction to "How to use Trackers for a mail form" - perfect
-A list of some objects - Okay... no idea what this is
-Some links to other wiki pages - OK, maybe there is an explanation to this...
-1. link: 5 steps to do after applying some profile - What's a profile?
-2. link: 7 steps to do after applying some profile, just for wiki 12 and on (I guess) - What's a profile?
-3. link: Links to nearly the same page, just for wiki 12 and on (I guess) - does not help
-4. link: Links to the same page - does not help

So, I searched for documentation for "Trackers", obviously I would need it. I found https://doc.tiki.org/Trackers, which looks very good at first glance, but then again it is really overwhelming as I have no Idea about what this feature is for. Obviuosly it is not just simply for mail forms... seems to have something to do with databases. What do I need a database for to have a mailform? It seems to me that I have to invest many hours to get a glimpse of what's going on here...

posts: 126885 United Kingdom

Hi @FootlooseTraveller

You're not the first to think this so DON'T PANIC (please), hopefully things will get clearer as you get more into it.

As mentioned on the Trackers doc page tikitrackers.org gives a pretty good high level overview of the feature - it started out as the Tiki bug tracker (and still is here) but over the years (and decades) it has grown into a bit of a monster!

This is why Tiki Profiles exist, which you can think of as macros - scripts that set up complicated features for a tiki in one click. So if you have a spare Tiki (not in production) you can try out the profile i mentioned before and that should end up with some instructions on how to use it. If not you can use http://demo.tiki.org/21x (i think it gets reset every Sunday night)

Gottago, hope we can help you through this!

P.S. We're always looking for people to help with the documentation, especially with the perspective of fresh eyes, so please do improve anything you think needs it as you go along if you can, thanks!

posts: 55

Hi @Jonny Bradley,

I finally did it. This video https://www.youtube.com/watch?v=h80QuuYxbhk from tikitrackers.org (by the way: on the page the video was cropped for me) got me the information to get started.

I now have:

  • A tracker
  • A form on my wiki page
  • An e-mail notification
  • Working wiki page templates for the e-mail body and subject
  • A Remarksbox after sending of the message/form on wiki page

However, I'm getting an error when I want to show the user what he sent after sending. I have the following code:

{TRACKER(trackerId="2" fields="6:7" action="Senden" showtitle="y" showdesc="y" email="6|FootlooseTraveller|wiki:Kontakt EMail tpl")}{REMARKSBOX(type="confirm" title="Nachricht erfolgreich versendet")}Antwortadresse: {trackeritemfield trackerId="2" fieldId="6"} Nachricht: {trackeritemfield trackerId="2" fieldId="7"}{REMARKSBOX}{TRACKER}

The code {trackeritemfield trackerId="2" fieldId="x"} yields the error: "Invalid Parameter: itemId". Somewhere I found, that "ItemId" is passed via the URL - which it is not - I guess it is passed as a html POST parameter. How can I fix this last little bit in Tiki 21 LTS?

posts: 126885 United Kingdom

Hi @FootlooseTraveller again

Nice, well done!

Regarding:

FootlooseTraveller wrote:
Copy to clipboard
{TRACKER(trackerId="2" fields="6:7" action="Senden" showtitle="y" showdesc="y" email="6|FootlooseTraveller|wiki:Kontakt EMail tpl")}{REMARKSBOX(type="confirm" title="Nachricht erfolgreich versendet")}Antwortadresse: {trackeritemfield trackerId="2" fieldId="6"} Nachricht: {trackeritemfield trackerId="2" fieldId="7"}{REMARKSBOX}{TRACKER}


Checking the code in lib/wiki-plugins/wikiplugin_trackeritemfield.php (i would usually use plugin list for this, but this should also work) it looks like the itemId either has to be on the URL request, or set in an itemId parameter.

So i think you'll need to move the response message to a new page, and set the url param on the tracker plugin to My-response-page?itemId (and itemId gets replaces with itemId=42 or whatever the itemId for the new one is)

HTH


posts: 8632 Israel

Hello @FootlooseTraveller,

I'm happy the tutorial I made helped.

If you had issues with the tutorial at tracker.org I suggest you check on my YouTube channel: https://www.youtube.com/c/BernardSfez or eventually you can check the auto directly on my website https://www.bernardsfez.com

Like @Jonny Bradley I use more the plugin list but he got it right.
If you want your tracker plugin to redirect to a page that display the itemId value you need to add the itemId to the url parameter.

Copy to clipboard
{tracker trackerId="n" fields="n1:n2:n3" action="Save and display the item" url="thewikipage?itemId"}


This is the basics, more may be need as well as permissions

posts: 55

Hi @Bernard Sfez / Tiki Specialist,
hi @Jonny Bradley,

I am understanding the following:

  • My error "Invalid Parameter: itemId" does not actually mean that there is a parameter inserted wrongly, but this parameter "itemId" is actually missing.
  • The missing parameter can be passed by URL.
  • During sending of the form, a custom URL can be defined. In the given URL the string "itemId" will be replaced with "itemId=xx", where xx is the new/current itemId.
  • {trackeritemfield}, according to documentation ("If it itemId is not specified and the url used to access the page has a itemId parameter, the value of itemId parameter will be used."), then automatically adds this parameter from URL, if present.

So, if I don't want any behavior changes other than to add "itemId" to the URL for this to work, I take the URL I get when sending the form

https://my.url/tiki-index.php?page=Impressum&ok=y&iTRACKER=1#wikiplugin_tracker1

add "itemId", strip protocol and domain and set URL parameter like so:

url="tiki-index.php?page=Impressum&ok=y&iTRACKER=1#wikiplugin_tracker1&itemId"

After testing this: The new URL seems to work - nothing changes except that itemId is added to the URL, including the actual Id value. Nevertheless, the error is the same. Seems like the URL param does not get automatically used in {trackeritemfield}.

Second test: I moved the parameter "ItemId" from the end of the parameter list to the start (and parameterized pagename for robustness) using

url="tiki-index.php?itemId&page=&ok=y&iTRACKER=1#wikiplugin_tracker1"

Voilà - it works as expected! But only if logged in as an admin. If I try as anonymous, on the confirmation page I get an error "You don't have permission to edit an Item" (Translated from german error message). The Item gets added. Then I don't want wo edit it, I just want to view my own item. If I don't have permission to view other items, this prevents the exploit that can show other items when you enter the itemId in the URL manually... or is there another way to prevent this?

Is there anything in the URL I pass, that can be further parameterized - as I did with the page name?

posts: 126885 United Kingdom

Well done @FootlooseTraveller, i guess some improvements (or a new version of) the contact form profile seem to be needed :-)

FootlooseTraveller wrote:
Voilà - it works as expected! But only if logged in as an admin. If I try as anonymous, on the confirmation page I get an error "You don't have permission to edit an Item" (Translated from german error message). The Item gets added. Then I don't want wo edit it, I just want to view my own item. If I don't have permission to view other items, this prevents the exploit that can show other items when you enter the itemId in the URL manually... or is there another way to prevent this?


There are some settings in Tracker properties => Permissions called "User can see his own items" and "Item creator can modify his items" but these depend on having a UserSelector field which "claims" ownership of the items a user creates... however this is tricky for anonymous users. I think there's a way of doing from the user's IP, but that's never going to be 100% reliable.

Ah, just read your post again, you don't want them to edit right? Normally you would just send them to a different "thank you" page, but i guess you could use the {PARAM} plugin to only add the {TRACKER} plugin if itemId is not present on the URL...

Does that get you to the next step? Hope so!

posts: 55

Hi @Jonny Bradley,

thanks again for the fast response!

So you think that the {TRACKER} plugin tries to edit them in the second call? I'll look into that. Thanks for the idea! I'll be back after fiddling around with it. ;-)

p.s. How do you escape "{TRACKER}"? I do with ~np~, but yours looks better. ;-)

posts: 55

Hi @Jonny Bradley,

thanks again for the right hint! Now it works as expected, in every detail.

{PARAM(name=ok value=y)}
{REMARKSBOX(type="confirm" title="Nachricht erfolgreich versendet")}Antwortadresse: {trackeritemfield trackerId="2" fieldId="6"}

Nachricht: {trackeritemfield trackerId="2" fieldId="7"}{REMARKSBOX}
{ELSE}
{TRACKER(trackerId="2" fields="6:7" action="Senden" showtitle="y" showdesc="y" url="tiki-index.php?itemId&page=&ok=y" email="6|FootlooseTraveller|wiki:Kontakt EMail tpl")}{TRACKER}
{PARAM}

I have an idea how to solve the issue that anyone can guess an itemId and get older messages to show up: After showing that the answer is successfully sent, I would like to just delete the item. At this moment, it is not needed anymore. I am completely satisfied to have the email sent to me.

Is there a plugin that just deletes a tracker item when the wiki source code is parsed? I would like something like:

{PARAM(name=ok value=y)}
{REMARKSBOX(type="confirm" title="Nachricht erfolgreich versendet")}Antwortadresse: {trackeritemfield trackerId="2" fieldId="6"}

Nachricht: {trackeritemfield trackerId="2" fieldId="7"}{REMARKSBOX}
{Delete tracker item itemId} command wanted here
{ELSE}
{TRACKER(trackerId="2" fields="6:7" action="Senden" showtitle="y" showdesc="y" url="tiki-index.php?itemId&page=&ok=y" email="6|FootlooseTraveller|wiki:Kontakt EMail tpl")}{TRACKER}
{PARAM}

I just made a new post for this question.

posts: 126885 United Kingdom
FootlooseTraveller wrote:
I have an idea how to solve the issue that anyone can guess an itemId and get older messages to show up: After showing that the answer is successfully sent, I would like to just delete the item. At this moment, it is not needed anymore. I am completely satisfied to have the email sent to me.


Hi FLT 😬

As you say you could use a {LISTEXECUTE} plugin with a cron job to remove the items, but usually i find they are a good backup and don't take up much space.

You can (and should) set the permissions on that tracker so Anonymous (or whoever) can create items only, keeping tiki_p_view_trackers for admins only, and then use the "User can see his own items" option with an owner user field if suitable.

jb


Upcoming Events

1)  21 Mar 2024 18:00 GMT-0000
Tiki Roundtable Meeting
2)  25 Mar 2024 17:00 GMT-0000
29th anniversary WikiBirthday (With Ward Cunningham)
3)  18 Apr 2024 18:00 GMT-0000
Tiki Roundtable Meeting
4)  16 May 2024 18:00 GMT-0000
Tiki Roundtable Meeting
5)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
8)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9) 
Tiki birthday
10)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting