hakana VIP
Total posts: 425
21 Oct 2014 18:36

Hi Sergey,

As you can imagine, this section will be full of questions soon :-)

I started to work on Cobalt by myself, somehow I managed to get the content dripping working. But I need some further help.

Here are my questions:

  1. For the type I have added a status field. Now every record (lesson) has a status (completed, not started). But I want it to behave like this: When the user completes the lesson, he checks his own lesson, but the others lesson status will not be affected. Is this possible? So far, when a user changes the status, the status of the whole lesson changes, not the users. I could not find a way to do it so far. (What I want is something more like a voting system. Each vote is specific to the user.)

  2. If the content is not opened to that user, I would like to hide the article title in the article list (the whole row if possible). Which template should I modify and how?

  3. At the bottom of the comment submission page, it says who can see these comments. For this section I would like to show only two groups like "only the members of this group" and "only me". I dont want to show other groups. How can I achieve this?

  4. When user makes a comment, is there a way to show only his comments to the user below the article no matter what privacy settings he has chosen? Can I filter his comments in some way so that his comments will be only visible to him?

More questions will follow. Thank you very much for your support.

Last Modified: 04 Nov 2014


Sergey
Total posts: 13,748
23 Oct 2014 04:18
  1. Status is connceted to record not to user. It means that if you have status to completed from ome user, it will change status of the article for all users. Just like on this forum. I select status solved and it is solved for all users.

But status still may be good if you create another type let's say homework. And allow user to submit sort of comment but it is homework. Then when you change status of that homework, next lesson may be opened through status changed SQL query feature.

  1. In custom template, when you list articles, just after foreach($this->items AS $item) you have to insert something like this.
if(!$item->fields_by_id[12]->access) continue;

Where 12 is an ID of the field.

  1. This parameter is only for admins. Registered users do not see it. You configure default values in comment parameters.

  2. FOr that, better use Cobalt type as comment adapter. Then it is simply another section of cobalt and all its parameters applys. You can restrict to only see author own records. To do so, pay attention on Type submission parameteres and Section Who can see restricted articles aparameter.


hakana VIP
Total posts: 425
23 Oct 2014 06:32

Sergey But status still may be good if you create another type let's say homework. And allow user to submit sort of comment but it is homework. Then when you change status of that homework, next lesson may be opened through status changed SQL query feature.

Is there any other way than using the status field? What do you recommend? I don't insist on using the status field.

  1. This parameter is only for admins. Registered users do not see it. You configure default values in comment parameters.

I understand this, but is there a way to create a listbox (or radio bottuns) with two groups where the user sets the groups that can see the comments? For example on your template, there is a private check box at the bottom. I can have two radio buttons like "I can see", "everybody of this group can see"


Sergey
Total posts: 13,748
24 Oct 2014 01:57

Status field is good. If something like homework submission is ok for you, then status is the way to go.

Unfortunately core comments are not designed for high level accesss management. I recommend simply use cobalt type as comment adapter, then you can do almost anything and use status field for that type.


hakana VIP
Total posts: 425
25 Oct 2014 08:30

Hi Sergey,

I really feel stuck at this point. I have limited time to launch my new section, I know that Cobalt can help me to build what I need, but I nearly have no idea about how to manage what you have indicated above. I understand that you have very limited time nowadays. Can you please refer me someone with whom I can build the new section.


hakana VIP
Total posts: 425
28 Oct 2014 19:37

Hi Sergey,

I am tryng to proceed step by step before I can find a person who cen help me. So here is the question:

On the blog page, where the record titles are listed (tasks in my case), how can I display a field value (status in this case) next to the commented record title entered by current logged in user in a comment (using cobalt type as comments).

I hope you understand since I have explained you what I am trying to do before.


Sergey
Total posts: 13,748
30 Oct 2014 11:13

hakana VIP
Total posts: 425
02 Nov 2014 15:01
  1. In custom template, when you list articles, just after foreach($this->items AS $item) you have to insert something like this.

    if(!$item->fields_by_id[12]->access) continue;

Where 12 is an ID of the field.

ID of which field? I hve tried the id of each field one by one but the template kept giving me these errors:

Notice: Undefined offset: 10 in .../components/com_cobalt/views/records/tmpl/default_list_yenibirben.php on line 84

Notice: Trying to get property of non-object in .../components/com_cobalt/views/records/tmpl/default_list_yenibirben.php on line 84


Konstantin
Total posts: 1,113
03 Nov 2014 08:36

Try make var_dump($item->fields_by_id); and you will see what in this array is keeping.


hakana VIP
Total posts: 425
03 Nov 2014 13:10

Hi Konstatin, when I did what you said, I saw that the field id was 5. When I used 5 as field id, it started to work. But, I still get the same error when I login as admin. test users don't get the error.


Konstantin
Total posts: 1,113
04 Nov 2014 09:55

it's strange it's don't work for all records or not. Maybe for admin shows more records and this records haven't value for field with id = 5, so you must first3check existing

if(isset($item->fields_by_id[5])){
    echo $item->fields_by_id[5]->result;
}
Powered by Cobalt