- Posts: 9
COMMUNITY FORUM
How to use K2 to make a directory
- Annie Jackson
- Topic Author
- Offline
- New Member
Less
More
14 years 11 months ago #75976
by Annie Jackson
How to use K2 to make a directory was created by Annie Jackson
Hi, I spent more than a month looking for what I thought would be a simple component. All I wanted to do was have a profile directory (for me it is for schools but it could be for your staff, for physicians, whatever). The required parameters were:
- The individual needed to be able to edit it
- I needed to be able to have specific fields which they would fill out
- Everyone needed to be able to comment / review the listing
- I did not want people to be able to create listings
I finally discovered K2 and realized I could manipulate it to do what I wanted. It also has a ton of extra features which I was not looking for but which I am going to be using. I have done a lot of work arounds in getting my site going, which I am happy to share, but this one in particular I wanted to give back to the community. Thank you to Joomlaworks for providing this as free software!
1) Create a special user group for the users that you want to have listings
2) Give these users permission to edit own items but not create listings
3) In Joomla itself you can either make these users authors or registered users. In order to assign them as the owner of a listing they must be authors, however I didn't want that because I have "real" authors on my site and I did not want the "article author" drop down menu to have hundreds of names in it. So what I did was I set them all to authors first. Then I created an article for each one and assigned them as the owner. Once it was all completely set up I changed them back to registered users. They will remain the author and thus remain capable to edit as long as you never touch the listing again. However if you open the listing to do your own edit you will have to do the changetoauthor-assignasauthor-changebacktoregistereduser trick again. (btw I actually created my listings via phpmyadmin as I have hundreds but if you will do them individually this is how you can make a registered user the author and this trick works for "regular" Joomla articles also).
4) I'm using a custom K2 template, you should too. This way you can make each area of your site that uses K2 be totally different from the other if you want. Now, for this listing I don't want the schools to much around with the title and possibly mess it up so I did the simple thing, I have the title hidden on the item and category view. I then formatted the template so that the author name looks like heading -- they are less likely to accidentally change it that way. The reason I did this is because a lot of people are really not as used to Internet stuff as we think and they may do something like change the title to "check out this cool school!" and totally mess up the directory without realizing it. Then when they did realize it they may have no idea how they did it and be afraid to tell me. I have experienced this, even my staff have made huge formatting errors in articles and I can only guess they simply do not notice that they have broken the site, despite me requesting they view everything after making edits. Of course they've lots their publishing privileges now but I don't want to have to be moderating every little change that a school makes so instead I want to lock out their ability to mess things up.
5) If you are using the Zak 2 Author CB plugin you will not be able to do this because it links the author name to the CB profile. If you still want to do this and normally have author names linked to profiles then I recommend you turn this plugin off, go get the Author Details plugin and edit the plugin code so that it links to the CB profile (I've attached the modified file, you still need the other files). This plugin doesn't show up on K2 articles so you won't have to worry about it.
Now you just have to play with the options and fiddle with your template to make it look the way you want but by following those instructions you will have a directory which only the listing owner can edit and which noone except you can add new listings to.
- The individual needed to be able to edit it
- I needed to be able to have specific fields which they would fill out
- Everyone needed to be able to comment / review the listing
- I did not want people to be able to create listings
I finally discovered K2 and realized I could manipulate it to do what I wanted. It also has a ton of extra features which I was not looking for but which I am going to be using. I have done a lot of work arounds in getting my site going, which I am happy to share, but this one in particular I wanted to give back to the community. Thank you to Joomlaworks for providing this as free software!
1) Create a special user group for the users that you want to have listings
2) Give these users permission to edit own items but not create listings
3) In Joomla itself you can either make these users authors or registered users. In order to assign them as the owner of a listing they must be authors, however I didn't want that because I have "real" authors on my site and I did not want the "article author" drop down menu to have hundreds of names in it. So what I did was I set them all to authors first. Then I created an article for each one and assigned them as the owner. Once it was all completely set up I changed them back to registered users. They will remain the author and thus remain capable to edit as long as you never touch the listing again. However if you open the listing to do your own edit you will have to do the changetoauthor-assignasauthor-changebacktoregistereduser trick again. (btw I actually created my listings via phpmyadmin as I have hundreds but if you will do them individually this is how you can make a registered user the author and this trick works for "regular" Joomla articles also).
4) I'm using a custom K2 template, you should too. This way you can make each area of your site that uses K2 be totally different from the other if you want. Now, for this listing I don't want the schools to much around with the title and possibly mess it up so I did the simple thing, I have the title hidden on the item and category view. I then formatted the template so that the author name looks like heading -- they are less likely to accidentally change it that way. The reason I did this is because a lot of people are really not as used to Internet stuff as we think and they may do something like change the title to "check out this cool school!" and totally mess up the directory without realizing it. Then when they did realize it they may have no idea how they did it and be afraid to tell me. I have experienced this, even my staff have made huge formatting errors in articles and I can only guess they simply do not notice that they have broken the site, despite me requesting they view everything after making edits. Of course they've lots their publishing privileges now but I don't want to have to be moderating every little change that a school makes so instead I want to lock out their ability to mess things up.
5) If you are using the Zak 2 Author CB plugin you will not be able to do this because it links the author name to the CB profile. If you still want to do this and normally have author names linked to profiles then I recommend you turn this plugin off, go get the Author Details plugin and edit the plugin code so that it links to the CB profile (I've attached the modified file, you still need the other files). This plugin doesn't show up on K2 articles so you won't have to worry about it.
Now you just have to play with the options and fiddle with your template to make it look the way you want but by following those instructions you will have a directory which only the listing owner can edit and which noone except you can add new listings to.
Please Log in or Create an account to join the conversation.