Create contentobject through customized form

Author Message

Clemens T

Saturday 08 October 2005 8:26:06 am

Hey all!
I want to be able to let users create objects through the normal ezpublish system, but I don't want to show them all the contentattributes, except for the ones that are admin.

like this:

--form

---- name _____
---- city _____
[admin only]
---- priority 1,2,3
---- active 1,0
[/admin only[
---- my telephone number ____

/- form

Thanks, for any comment at all!
Greets,
Clemens

Xavier Dutoit

Sunday 09 October 2005 3:15:17 am

Hi,

What I usualy do in these cases is on the custom edit.tpl, fetch the current_user and based on the groups, section show it parts of the template.

X+

http://www.sydesy.com

Clemens T

Sunday 09 October 2005 5:52:59 am

OK, that sounds good. But now I have one remaining problem, how can I get a link to 'create a new object of this class', without the button and the dropdown?
Greetz,
Clemens

Gabriel Ambuehl

Sunday 09 October 2005 6:25:12 am

Do look at the HTML that is usually used. It's easy to figure out. Just make the selector a hidden form field instead.

Visit http://triligon.org

Clemens T

Sunday 09 October 2005 7:43:55 am

OK, many thanks to both!

Got it.. now what I want to do, is hide some of the attributes, and submit a default value with them.

Because I'm now overriding edit_attribute.tpl.. but not there yet.. how should I build this statement and.. more important.. how can I make sure the 'hidden values' are submitted correctly (to ensure default values upon submit).

Thanks,
Clemens

Xavier Dutoit

Sunday 09 October 2005 9:56:42 am

Hi Clemens,

Have a look at this contrib, might do what you want to prefill the content:
http://ez.no/community/contribs/hacks/object_creator

However, it doesn't solve the validation problem (ie you can change these values easily). If you want to be 100% certain of the values, then create a custom event and put it in the publication workflow.

X+

http://www.sydesy.com

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

eZ debug

Timing: Jan 20 2025 17:22:00
Script start
Timing: Jan 20 2025 17:22:00
Module start 'layout'
Timing: Jan 20 2025 17:22:00
Module start 'content'
Timing: Jan 20 2025 17:22:02
Module end 'content'
Timing: Jan 20 2025 17:22:02
Script end

Main resources:

Total runtime1.5670 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.0469151.2266
Module start 'layout' 0.00550.0042 739.273436.6797
Module start 'content' 0.00971.5564 775.9531623.4063
Module end 'content' 1.56620.0008 1,399.359411.8125
Script end 1.5670  1,411.1719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.2083160.0002
Check MTime0.00130.0846160.0001
Mysql Total
Database connection0.00080.048410.0008
Mysqli_queries1.510296.3770680.0222
Looping result0.00070.0458660.0000
Template Total1.525297.320.7626
Template load0.00210.131720.0010
Template processing1.523197.198720.7615
Template load and register function0.00020.014710.0002
states
state_id_array0.00220.142910.0022
state_identifier_array0.00200.127020.0010
Override
Cache load0.00170.1105340.0001
Sytem overhead
Fetch class attribute can translate value0.00080.048230.0003
Fetch class attribute name0.00110.070970.0002
XML
Image XML parsing0.00090.060230.0003
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00090.0586160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 25
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs