Forums / Setup & design / Stumped on relating objects

Stumped on relating objects

Author Message

Joanie Chembars

Wednesday 12 January 2005 9:42:08 am

I can't seem to figure this out --
I am using 3.4.4.
Here's the situation >>
When the users register, they select which units (can be multiple) they belong to in our organization on the registration page.
These users then create 'articles' and I need to attach which unit that person belongs to onto the articles that they create. Why? So that if someone wants to search by unit they will see all the articles posted related to that unit.
Make any sense to you out there? Any hints would be greatly appreciated!!
Thanks --
Joanie

Joanie Chembars

Wednesday 12 January 2005 12:05:29 pm

OK -- I figured out that I can use the object relation datatype to link the article class to the folder where all of the users are stored. But, this provides a scrolling list of the users and I would like for it to automatically select the user that is entering the article.
Any ideas?

Joanie Chembars

Wednesday 12 January 2005 1:51:04 pm

Well, I now know what I need to do, just not how to do it ---
I need to get the current user's id number and make the object relation attribute take that value.
Am I missing something obvious???
help please........

Ɓukasz Serwatka

Wednesday 12 January 2005 1:57:25 pm

Hi,
Here is a example how to fetch user data
http://ez.no/ez_publish/documentation/reference/data_fetching/user/current_user

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Joanie Chembars

Thursday 13 January 2005 5:52:17 am

Can't believe I didn't run across that doc in all my searches. Exactly what I needed for the fetch. Halfway there, just need to figure out how to set that variable to the value now.
joanie