Forums / General / form creation

form creation

Author Message

srikanth mn

Tuesday 28 July 2009 5:01:50 am

I have created a class called Meeting RFP. it's id is "meeting_rfp". I have template called meeting_rfp.tpl which would override pagelayour.tpl.

problem is i am not able to over the file even after the declaration in override.php

[Meeting RFP]
Source=pagelayout.tpl
MatchFile=meeting_rfp.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

can anyone help me out how call the class filed in my meeting rfp.tpl...

Max Keil

Tuesday 28 July 2009 4:39:36 pm

Hi,

your override seems to be ok - I think you have placed the template on the right position.

/design/override/templates/meeting_rfp.tpl

Cleared the caches after creating this rule?

Another note: [Meeting RFP] -> change to [MeetingRFP] no whitespaces between the words.

If it not helps you - another way:
Check your override.ini.append.php again - maybe you have another override for the pagelayout in it! Your specific overrides should be placed much more on the top of the file - this little example describes it:

override.ini.append.php

[MyPagelayout]
Source=pagelayout.tpl
MatchFile=mypagelayout.tpl
Subdir=templates

[MeetingRFP]
Source=pagelayout.tpl
MatchFile=meeting_rfp.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

In this case the mypagelayout.tpl will be shown, even if your current Object is meeting_rfp. After rotate the both rules:

[MeetingRFP]
Source=pagelayout.tpl
MatchFile=meeting_rfp.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

[MyPagelayout]
Source=pagelayout.tpl
MatchFile=mypagelayout.tpl
Subdir=templates

In this case meeting_rfp.tpl will only be displayed if your content object is type of meeting_rfp otherwise mypagelayout.tpl will be shown.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Wednesday 29 July 2009 5:41:13 am

I have create a class called meeting RFP and it's id=meeting_rfp. I have two attributes with ID
first_name and surname. how do i call this class in any template and display fist name and sirname fields......?

Max Keil

Wednesday 29 July 2009 3:35:40 pm

So your override rules already working?

If you call a link which is type of meeting_rfp class you can access the $node variable. This variable is automatically set by eZ Publish on the node view.

The attributes stored in this node are placed in $node.data_map:

{attribute_view_gui attribute=$node.data_map.first_name}
{attribute_view_gui attribute=$node.data_map.surname}

This displays the datatype view of this attribute. In most cases you can directly access the content by:

{$node.data_map.first_name.content}

You can also check if your variable has some content by:

{if $node.data_map.first_name.has_content}
...
{/if}

Try to use the attribute(show) operator for the variables it displays you the whole dump for this variable.
{$node.data_map.first_name|attribute(show)}
In most cases it helps you to resolve the problem.

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Thursday 30 July 2009 7:07:20 am

No it's not working....

I have created the article it's node id is 145, where i am displaying some content....below this i want to display the form of meeting rfp where i have created the class with id meeting_rfp.
Meeting RFP is menu link...i am calling this as below

<a href={'/content/view/full/145' |ezurl()} class="menu">Meeting RFP</a>

my override is

[Meeting]
Source=pagelayout.tpl
MatchFile=meeting_rfp.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

now when i click on Meeting RFP it just fetch the content in article node 145 but it does't display any form......following is the code in Meeting RFP

--------------------Code------------
{$module_result.content}

{attribute_view_gui attribute=$node.data_map.first_name}

{attribute_view_gui attribute=$node.data_map.surname}
--------------End of code----------

can any one please help me where i am going wrong

Paul Wilson

Thursday 30 July 2009 8:23:03 am

Hi Srikanth,

You might find my article on forms useful.

See: http://ez.no/developer/articles/how_to_create_ez_publish_forms

hope that helps

- Paul

Max Keil

Thursday 30 July 2009 11:13:16 am

Hi,

are you trying to override the pagelayout.tpl for every class? Is it required?

Here are some information about the pagelayout:
http://ez.no/doc/ez_publish/technical_manual/4_0/templates/the_pagelayout

override.ini.append.php

[MeetingRFP]
Source=pagelayout.tpl
MatchFile=meeting_rfp_pagelayout.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

This rule overrides the pagelayout if a node of class meeting.rfp were displayed.

$module_result is a variable inside the pagelayout. with:

{$module_result.content}

inside the pagelayout you can display the content of your node!!!

to override the template that is displayed for $module_result.content you should use this:
override.ini.append.php

[MeetingRFP_class]
Source=node/view/full.tpl
MatchFile=full/meeting_rfp.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

Now your pagelayout is placed in: /design/plain_site/override/templates/meeting_rfp_pagelayout.tpl
With the last override rule you matches the content inside of $module_result.content.
And this is the template: /design/plain_site/override/templates/full/meeting_rfp.tpl

Inside of this content template you can use $node variable!

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Friday 31 July 2009 6:35:54 am

I am able to display only send button....following is the code in meeting rfp page

{* Meeting RFP - Full view *}

{* form introduction *}

<form method="post" action={"content/action"|ezurl}>

{* Given Name *}

<h4>{$node.data_map.given_name.contentclass_attribute.name}</h4>

<div class="attribute-given-name">

{attribute_view_gui attribute=$node.data_map.given_name}

</div>

{* Form buttons - Processing *}

<div class="content-action">

<input type="submit" class="defaultbutton" name="ActionCollectInformation" value="{"Send form"|i18n("design/ezwebin/full/feedback_form")}" />

<input type="hidden" name="ContentNodeID" value="{$node.node_id}" />

<input type="hidden" name="ContentObjectID" value="{$node.object.id}" />

<input type="hidden" name="ViewMode" value="full" />

</div>

</form>

can any one tell where i am going wrong....

Max Keil

Friday 31 July 2009 2:27:04 pm

If your override.ini is like this:

[MeetingRFP]
Source=pagelayout.tpl
MatchFile=meeting_rfp_pagelayout.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

the you have to fetch the node before you can use it in 'meeting_rfp_pagelayout.tpl':

{def $node = fetch( 'content', 'node', hash( 'node_id', #NODEID# ) ) }

but if your override.ini is like this:

[MeetingRFP_class]
Source=node/view/full.tpl
MatchFile=full/meeting_rfp.tpl
Subdir=templates
Match[class_identifier]=meeting_rfp

you can use the $node variable inside of 'meeting_rfp.tpl'

<form method="post" action={"/content/action"|ezurl}> - do not forget the leading slash!

Is your attribute called given_name?

Mit freundlichen Grüßen
Best regards

Max Keil

____________________________________________________________
eZ Publish Gold Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

srikanth mn

Monday 10 August 2009 12:05:01 am

How to create Radio button while creating class and how to call this in tempelate

eZ debug

Timing: Jan 18 2025 02:51:23
Script start
Timing: Jan 18 2025 02:51:23
Module start 'content'
Timing: Jan 18 2025 02:51:25
Module end 'content'
Timing: Jan 18 2025 02:51:25
Script end

Main resources:

Total runtime1.4519 sec
Peak memory usage4,096.0000 KB
Database Queries217

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0091 587.5313180.8594
Module start 'content' 0.00911.2907 768.3906698.1875
Module end 'content' 1.29980.1520 1,466.5781348.4688
Script end 1.4518  1,815.0469 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00490.3357210.0002
Check MTime0.00190.1312210.0001
Mysql Total
Database connection0.00090.063010.0009
Mysqli_queries1.341992.41972170.0062
Looping result0.00280.19282150.0000
Template Total1.418697.720.7093
Template load0.00230.159520.0012
Template processing1.416397.542420.7081
Template load and register function0.00010.010210.0001
states
state_id_array0.00100.071210.0010
state_identifier_array0.00100.068820.0005
Override
Cache load0.00220.15021170.0000
Sytem overhead
Fetch class attribute can translate value0.00100.068240.0002
Fetch class attribute name0.00120.0800120.0001
XML
Image XML parsing0.00130.089840.0003
class_abstraction
Instantiating content class attribute0.00000.0020150.0000
General
dbfile0.00550.3757330.0002
String conversion0.00000.000530.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
10content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
29content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
11content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 68
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs