10809 Posts in 2495 Topics by 1783 members
|Go to End|
31 January 2011 at 10:49am
I'm just starting work on a new site, a bit like gumtree or craigslists - where users create an account -and can then post listings.
I'm thinking the 'member profiles' module is a good start - but does any one have any advice the best way of then allowing users to create their 'listing' pages - each user will be able to create a number of listings.
31 January 2011 at 10:26pm
I have only good experiances of working with the member profile module and think you'll have good use of it. Might be worth thinking of the facebook connect module also, or a combination of the two. I have this far found the facebook module to have a few more 'roadbumps' though.
When it comes to the listing pages I think you just do it! Get the data model in place with classes and how they shall relate to each other. Then set up the forms for adding and editing records. The controllers has a static $allowed_actions that can be used to handle permissions so that a member only can edit his own data objects and so on.
I don't think your users will need to create 'listing pages' that will be a lot of overhead. If you make them unversioned data objects instead you can have generic controller or pagetypes listing and presenting them by using a URL pattern you set by Director::addRule()
1 February 2011 at 7:17am
Hi Capt Morgan,
thanks for your comments - firstly - good to know it's possible. Getting the facebook connect module running is my next task.
to be honest, i'm pretty much new to silverstripe, so i'm not quite sure I can 'just do it!'. But thanks for the pointers.
You're right in that I don't want users to create a 'page' for each listing - if the site ends up a few thousand listing pages it would just be crazy - so i just want to store info in the database and have a pages likes mysite/listings/1235/.
2 February 2011 at 4:53pm Last edited: 2 February 2011 4:54pm
Create a DataObject called Listing, add your fields and necessary stuff etc. Make sure you have a has-many connection for the member profile (Member profile has many Listings) and a has-one connection for the listing (Listing has one Member profile).
Then on the member profile, build several functions in the controller that will allow you to have CRUD options for the listings - create, read, update, delete. Example:
You won't even need to create pages for the listings with this method, all you'd need is the member profile page. And then of course you gotta build a few template loops for displaying the listings.
Hope that helps more! Check the silverstripe docs for info on the datamodel, dataobjectmanager, controller and URL handling. Here's a link: http://doc.silverstripe.org/sapphire/en/topics/controller
4 February 2011 at 2:25pm
Thanks, I managed to get something working - but i think the 'relationship' set up you have talked about would be a better solution. I'll keep learning!
4 August 2011 at 6:09am
i think this topic is quite similar to my needs, im currently working on a "listing" style website.
users will be able to sign up and list their holiday homes/properties similar to what you see here: http://www.ownersdirect.co.uk/brazil-north-east-2bed.htm
ideally, i plan to have users create a profile on my site, then subscribe with paypal to "publish" their listing.
so far I have installed the "memberprofiles" module which i THIK will work fine. I will just add lots more fields to the members page, and a has_many for all of the property images.
paypals subscription/recurring payments seems easy enough, i just need to tweak it all a little to get it working.
basically i wondered if anybody has any experience at all with this? will the memberprofiles module be suffice? what about if my users have more than 1 property? will they have to create a profile for each one? (thats not ideal!)
i'm guessing i need to store all of the properties as objects using DOM, then i can create pages dynamically as seen in this topic: http://www.ssbits.com/tutorials/2010/dataobjects-as-pages-part-1-keeping-it-simple/
can somebody help at all with how i start to create a "property" object that only the owner can create/edit?
obviously this all needs to happen in the front end as they wont have CMS access.
7 August 2011 at 7:07am
nobody can help then?
to update, I have the paypal subscription working fine now. when a user pays, paypal send the IPN and it all writes to the database fine.
however, how do i query that database when listing the properties in the front end?
it needs to lookup the table, and check the payment status, if its failed then the product/property should be marked as offline and not be listed on the site, it its all paid OK then it should be marked as live and be online...
can anybody help with this part?
|Go to Top|