Forums / Cotonti / Support / cot_message() question

tensh
#1 2012-12-06 09:44

I reminded myself a question:

I have a plugin where in list category somebody can check pages using standard form with checkboxes and add them to a basket. It then redirects them back to that category. I would like to ask if cot_message() works in page lists? I tried to add a notification about this event but I didn't succeed. So by now it just adds the items without saying anything.

I wanted to redirect to page category with a get value (&message=1) and add the condition that would display the notification through cot_message(), but it didn't work. Help please?

lukgoh
#2 2012-12-06 10:56
#36397 Trustmaster:

Messages use sessions to store values. So they will be displayed after redirect if they haven't been displayed yet.

 

I dont think you need to use the get value as you can just use cot_message as long as you are parsing the messages in the catrgory page: cot_display_messages($t);

Trustmaster
#3 2012-12-06 11:01

By default a category doesn't expect any messages so it doesn't display them. You need to add the line Luke has mentioned in your plugin hooking into page.list.tags and also the necessery stuff in the template:

{FILE "{PHP.cfg.themes_dir}/{PHP.cfg.defaulttheme}/warnings.tpl"}

 

May the Source be with you!
tensh
#4 2012-12-06 12:56

Yeah, I added the TPL to the page.list.tpl and also added "cot_display_messages($t)"... but now I don't remember if I added it in page.list.tags hook. Probably in page.main ... I'll check it out, be right back.

Added 9 minutes later:

Yes, now it works - I moved cot_display_messages($t) to page.list.tags and now it works :)

Thank you :)

This post was edited by tensh (2012-12-06 13:04, 11 years ago)