Forums / Setup & design / Manually choose which attributes to edit

Manually choose which attributes to edit

Author Message

Roy Bøhmer

Thursday 29 July 2004 2:06:23 am

Hi!
Lets say I've made a class with 2 attributes: name (textline) and email (email). The email-attribute is required.
Now I want anonymous users to make new objects of this class. This is no problem when using code like

{include uri="design:content/edit_attribute.tpl"}

But how do I write the code if I only want the useres to fill in ONLY the email-attribute? In other words: I dont want them to be presented to a textline where they have to fill in their name.
I've tried to find the golden documentation page on how to make the form manually, but with no luck.

The html-output is something like

<input type="hidden" name="ContentObjectAttribute_id[]" value="785" />
<input class="" type="text" size="40"  name="ContentObjectAttribute_ezstring_data_text_785" value=""  />

and I think the name="..." is my problem. But how to make it dynamic?

Thanks!
Roy

Paul Forsyth

Thursday 29 July 2004 2:47:38 am

Try this:

If you are editing something then the varaible $content_attributes will be. You need to select the correct attribute to make this work...

<form>
{let email_attribute=$content_attributes[1]}

{attribute_edit_gui attribute=$email_attribute}
<input type="hidden" name="ContentObjectAttribute_id[]" value="{$email_attribute.id}" />

<input type="submit" name="PublishButton" />
<input type="submit" name="CancelButton" />

{/let}

</form>

Hope this helps

paul

--
http://www.visionwt.com

Roy Bøhmer

Thursday 29 July 2004 5:52:30 am

Aaah! Thanks! Things are getting clearer.
But this means the user has to press some kind of Edit or New-button first. I would like to have the form present all the time, much like the search-form (even if my first post didn't tell). The intention is to make it easy for people to subscribe to a newsletter. But if my "clear" understanding is right I have to make a content/edit-call before I will be able to publish new objects, or..?

Roy

Paul Forsyth

Thursday 29 July 2004 6:01:37 am

If you are creating new objects a call to content/edit is the best way to go. If you are making any kind of form submit you always need a way of making the form submit, so buttons (of whatever form) are needed :)

It sounds like you want something like kernel/content/tipafriend.php. Have a look at how this code works, passes information from the html to the php underneath. Objects can then be created as you need.

paul

Roy Bøhmer

Thursday 29 July 2004 6:51:57 am

Thank you. I'll look into the tip-a-friend stuff soon. I've also made a module in order to send SMS, so I might just do some adjustments to make it create new objects. Wonder why I didnt think about doint it in php before. Well, I'll blame it on the fact that everybody else is on vacation and I still sit here :-)

Brendan Pike

Sunday 31 October 2004 7:09:17 pm

I'm quite interested to know what you created regarding the SMS module. I'm wondering if anyone has created a workflow extension to SMS as well as email when triggered.

www.dbinformatics.com.au

We are always interested in hearing from experienced eZ PHP programmers and eZ template designers interested in contract work.

eZ debug

Timing: Jan 19 2025 03:31:49
Script start
Timing: Jan 19 2025 03:31:49
Module start 'content'
Timing: Jan 19 2025 03:31:49
Module end 'content'
Timing: Jan 19 2025 03:31:49
Script end

Main resources:

Total runtime0.2356 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0089 589.0859180.8125
Module start 'content' 0.00900.0072 769.898497.9453
Module end 'content' 0.01620.2193 867.8438527.3750
Script end 0.2355  1,395.2188 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00371.5596200.0002
Check MTime0.00150.6380200.0001
Mysql Total
Database connection0.00070.290810.0007
Mysqli_queries0.180576.62161410.0013
Looping result0.00170.72021390.0000
Template Total0.218892.910.2188
Template load0.00100.417710.0010
Template processing0.217992.486910.2179
Override
Cache load0.00070.292910.0007
Sytem overhead
Fetch class attribute can translate value0.00110.460210.0011
XML
Image XML parsing0.00020.090410.0002
General
dbfile0.00682.9070200.0003
String conversion0.00000.003430.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs