Jump to content

Categorize files associated with a user


renobird
 Share

Recommended Posts

I'm a bit stumped on how to approach this, so I'll just explain what I'm after and hopefully someone can point me in the right direction.

I have a files field for my users so they can associate files with their profile.

I'm looking for a way to also allow them to categorize or tag those files.

My goal is to be able to call these files from the front-end. (i.e. get all files for User1 in CategoryA, or get all files for all users in categoryA).

I suspect this is possible with PW, but I can't seem to figure out how.

Any direction is much appreciated.

:)

Link to comment
Share on other sites

Reno: with the current file field it is not possible to create relation to other pages. If you don't want to dive into building your own fieldtype (allowing multiple files + page references for each file) your option is to keep files in some other branch. Then you would have this kind of setup:

user-file template

Template has fields user, categories and file

User is single page reference for user.

Categories is multiple page reference for your categories.

File is single file.

Link to comment
Share on other sites

Hi Apeisa,

Can you walk me through how it would reference each user? Would I have to manually create a new page for each user in that separate branch?

I'll end up with about 200 users roughly, and they will come/go quite frequently. Is there a way to automate the reference?

Sorry if this is rudimentary PW stuff. :)

Link to comment
Share on other sites

Hmm.. now that I think of: you can probably add those pages as children for users. Edit user template and allow user-file as children. Then you can remove that user reference, since they are always under correct user.

I have never expanded user profiles this way, but I don't believe there are any nasty side-effects for doing so.

Link to comment
Share on other sites

With apeisa's help, I did manage to get this working. I'll post the code soon for anyone else that might need something similar.

Yes please. Were you also working on a front-end form for users to update their profiles? Or did I dream it?

Cheers

Marty

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...