danielbidala VIP
Total posts: 153
08 Feb 2015 21:30

I read the the "Render articles list" API documentation but it is not completely clear how to solve this:

I'd like to render list of records with specific field value but not with prefiltered links. I have to add another tab for user homepage where I can list these records. I can create this tab in the default_user_block.php but don't know how to get list of records there.

Another way is to create another cobalt menu type and then created menu item of this type to render the list.

Last Modified: 18 Feb 2015


pepperstreet VIP
Total posts: 3,837
08 Feb 2015 22:18

Hello danielbidala,

What about Records module? It already has two parameters to get records with a specific field value.
Either take a look into the module code, or use it directly and render a module-position.
(Since you are on a user's homepage, you could also show the records-module in that context in your joomla template...)


danielbidala VIP
Total posts: 153
10 Feb 2015 14:57

Hello pepperstreet,

thanks for suggestion.

Some background information about my project: I build intranet site for small company. One of type is called tasks. Boss can create task and add user(responsible) to it with a db query multiselect field. One task can have multiple user (responsible). I need a tab on user page to show a list with tasks where he or she is selected as responsibe user. I hope it is undarstandable.

(I think cck like cobalt must support MULTIPLE AUTHOR if so, all of my problem go away. Multiple author is helpful in lot of cases: intranet sites for companyes, scientific publications sites, tech sites with phone reviews etc. Long articles with more pages often has multiple authors.)

I can render article list that I need with cobalt API using db query to populate $ids but I'dont know where to put this code make it work in user page. Using the records module itself isn't good for me because I have to get current user and include it in my query.

Any suggestion on this? Or how to create my own cobalt joomla menu type to create custom cobalt records list?


pepperstreet VIP
Total posts: 3,837
10 Feb 2015 20:29

danielbidala I think CCK like cobalt must support MULTIPLE AUTHOR if so, all of my problem go away.

Maybe. Sounds obvious, but it could be viewed from different angles...
does it have to use real (Joomla) user accounts, or does it work with a different kind of "object". I mean anything that helps to create your specific tasks and workflow with current Cobalt features. Or even a different extension (in addition).

BTW, this topic and improved feature for Cobalt 9 might be of interest for you:

danielbidala Any suggestion on this?

Just some rough ideas and thoughts...

  • What if you use Cobalt's existing relation fields. In other words, users have a specific profile content type. And you would attach tasks (child) records to it. Or even vice-versa ?!
  • What about storing or linking J! users to a task (record). I mean apart from being a real "author". Just collect the userID's with a custom multi-value field.
    (Maybe utilize the code from author-select dialog on article edit, but with multiple selection?! Or like the Cobalt user selection in re-post on homepage feature)

danielbidala VIP
Total posts: 153
11 Feb 2015 09:15

Hey pepperstreet, it's an interesting idea

What if you use Cobalt's existing relation fields. In other words, users have a specific profile content type. And you would attach tasks (child) records to it. Or even vice-versa ?!

Do you mean:

  1. Create two content types users and tasks
  2. In user content type every user has own record (he or she is the author of it)
  3. When boss creating task he can attach user with parent field (from user content type) to it

Questions about this method:

  1. I need email notifications when user has new task. Is this possible with new child event type? (I need to notify only the user about he has new task)
  2. With cobalt register field can logged in user create new user?

What about storing or linking J! users to a task (record). I mean apart from being a real "author". Just collect the userID's with a custom multi-value field. (Maybe utilize the code from author-select dialog on article edit, but with multiple selection?! Or like the Cobalt user selection in re-post on homepage feature)

This was my original plan. I have a multiselect field with J! users db query. Boss can select user(s) with this field. But the question, how to create user 'homepage' to show only those records where he or she is selected. The prefiltered links is not good for me. I can get the records list where current user is selected with cobalt api but don't know where to paste the code. Or how to create custom page with this code.


pepperstreet VIP
Total posts: 3,837
13 Feb 2015 03:53

danielbidala Do you mean: 1. Create two content types users and tasks

Yes.

  1. In user content type every user has own record (he or she is the author of it)

Yes, limit to 1 record per user.

  1. When boss creating task he can attach user with parent field (from user content type) to it

Yes. I guess, from boss' perspective (the task creator) it seems the logical direction...

Nice sideeffects:
- Task section gives a nice overview, with all Cobalt list features
- "Attach user" can be done on list with AJAX as well. No need to view the task full view. (AFAIK)

Questions about this method: 1. I need email notifications when user has new task. Is this possible with new child event type? (I need to notify only the user about he has new task)

Not sure.

There are specific section and notification events for:

  • New parent record
  • New child record
  • Parent is attached
  • Child is attached
  1. With cobalt register field can logged in user create new user?

Sorry? Don't understand.


Another idea:

Cobalt's repost feature?! Boss creates the task... and reposts it on user's homepage.
There are also events:
- Your record reposted
- New record posted on your homepage (!)


danielbidala VIP
Total posts: 153
16 Feb 2015 11:44

Thanks for helping peepperstreet again.

I figured out how to create custom records lists without prefiltered links. I can use this method on user's homepage to create custom tabs. (In my case records where user is added with multiple select field)

To use this method we have to add some custom line of code to cobalt core and then we have to use view_what in the link.

If anybody interested in this I can write a step by step guide.


Sergey
Total posts: 13,748
16 Feb 2015 13:44

danielbidala If anybody interested in this I can write a step by step guide.

Yes please.


danielbidala VIP
Total posts: 153
17 Feb 2015 20:13

Ok, to write a correct step by step I need to know one more thing:

Where to add my custom view_what to _getUsermenuCounts (Need to show count for this tab)


Sergey
Total posts: 13,748
18 Feb 2015 05:54

Огые write what you have now and I'll edit it later.

Powered by Cobalt