Forums / Setup & design / Class - user input?

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.

eZ debug

Timing: Jan 18 2025 02:18:56
Script start
Timing: Jan 18 2025 02:18:56
Module start 'content'
Timing: Jan 18 2025 02:18:56
Module end 'content'
Timing: Jan 18 2025 02:18:57
Script end

Main resources:

Total runtime1.1111 sec
Peak memory usage4,096.0000 KB
Database Queries211

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 588.7266180.8438
Module start 'content' 0.00600.9452 769.5703627.9375
Module end 'content' 0.95120.1599 1,397.5078341.0859
Script end 1.1111  1,738.5938 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3594210.0002
Check MTime0.00160.1483210.0001
Mysql Total
Database connection0.00070.066810.0007
Mysqli_queries1.024492.19742110.0049
Looping result0.00220.19822090.0000
Template Total1.087897.920.5439
Template load0.00210.187220.0010
Template processing1.085797.711720.5429
Template load and register function0.00040.032510.0004
states
state_id_array0.00080.068410.0008
state_identifier_array0.00060.057820.0003
Override
Cache load0.00180.1660460.0000
Sytem overhead
Fetch class attribute can translate value0.00150.132640.0004
Fetch class attribute name0.00160.143090.0002
XML
Image XML parsing0.00100.087540.0002
class_abstraction
Instantiating content class attribute0.00000.0023100.0000
General
dbfile0.00720.6484280.0003
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs