Class - user input?

Author Message

Jonathan Stubbs

Wednesday 16 April 2003 8:10:13 am

Hi,

I have set up a new class called "Jobs" for a site I have. In this site I want to list the latest jobs that have been added. This part works fine for me, but I do not quite know how to have a "add your job" form on the site.

This form should allow users to post a new job if they have one. However, If I change the Jobs class to include "information collector" on all the form fields (as per the tutorial), it messes up the jobs listings on the other page.

Is there a good way of adding a form on a page using this class that writes the info entered into the db?

I have created two template files - line_class_31.tpl and full_class_31.tpl in this case and added them to the overide/templates/node/view/ folder in my design folder.

Paul Borgermans

Wednesday 16 April 2003 8:36:31 am

You need to use the normal edit functions for objects: see for example how it is done for editing articles and adding forum messages, its all in the templates. You may want to write an edit override template for it too. And finally, make sure the roles are set right for doing so.

hth

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Jonathan Stubbs

Wednesday 16 April 2003 8:44:51 am

Thanks Paul. I will check it out again and post back.

BTW, I have also installed a fresh copy onto my local OS X machine without the demo data. Maybe its easier to start with a fresh slate :-)

Gabriel Ambuehl

Wednesday 16 April 2003 11:26:05 am

It most certainly is easier to start without the demo data and all the roles it comes with.

Visit http://triligon.org

Paul Borgermans

Wednesday 16 April 2003 11:36:52 am

But you don't need to setup the demo data just for that, the (override) templates are of the demo are there anyway.

Or you may just delete the demo data after a few days of learning and adding your own.

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Jonathan Stubbs

Wednesday 16 April 2003 3:25:31 pm

Paul,

I have had a look at the edit_class*.tpl files and they are helpful. Where I am getting stuck is what to do first - in my case adding a "job" will be done by the users on the site.

Another part of the site will list all the jobs that have been entered by the users. In the Forums example, there are separate classes for forums and forum_messages.

Articles (as far as I can see so far) have Comments, which again is a separate class.

I am sure I am missing the obvious here - am not sure where to start and could use a tip to get me going....should I create two separate classes i.e. Jobs and Add_Job?

Thanks for any help.

Gabriel Ambuehl

Thursday 17 April 2003 4:01:56 am

Actually, you can do that much like a forum:

Create a Job_Folder Class.

Create a Job_Ad Class.

Now set roles so that users can read both classes.

Additionally you need a role that allows for creating of Job_Ad classes if the parent class is Job_Folder.

Quite simply, actually.

Visit http://triligon.org

Jonathan Stubbs

Thursday 17 April 2003 9:10:49 am

Hi Gabriel,

I now have 2 classes - "Jobs" and "Add Job". In the site I have a folder called (no surprise!) "Jobs" inside which the latest jobs are displayed. This works fine.

I changed the "anonymous" user role to allow this user to create an "Add Job".

Now I have created a new folder (inside Jobs) called Add your job. I am a little uncertain as to the next step - I tried to insert the "Add Job" form but nothing shows up. The object name in the Add Job class is "job_title" which is for the user to insert, so when I publish the Add Job nothing shows up.

If I edit the Add Job to include the title then it does show up. I know I have to edit the full_class*.tpl file so that it shows up the way I want, but am I supposed to create and edit an edit_class*.tpl file too?

What about the information collector? Is this only for email forms? I would like to have certain fields required....

I guess it sounds like I am confused because I am confused!

Thanks for any help.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.