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

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 18 2025 10:37:50
Script start
Timing: Jan 18 2025 10:37:50
Module start 'layout'
Timing: Jan 18 2025 10:37:50
Module start 'content'
Timing: Jan 18 2025 10:37:50
Module end 'content'
Timing: Jan 18 2025 10:37:50
Script end

Main resources:

Total runtime0.6358 sec
Peak memory usage4,096.0000 KB
Database Queries80

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0085 587.7813152.6094
Module start 'layout' 0.00850.0037 740.390639.3984
Module start 'content' 0.01230.6218 779.7891693.1328
Module end 'content' 0.63410.0017 1,472.921924.2031
Script end 0.6358  1,497.1250 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.5501160.0002
Check MTime0.00140.2221160.0001
Mysql Total
Database connection0.00240.378210.0024
Mysqli_queries0.525682.6625800.0066
Looping result0.00090.1395780.0000
Template Total0.599594.320.2997
Template load0.00230.363220.0012
Template processing0.597293.916320.2986
Template load and register function0.00020.033510.0002
states
state_id_array0.00290.456310.0029
state_identifier_array0.00110.179220.0006
Override
Cache load0.00230.36821170.0000
Sytem overhead
Fetch class attribute can translate value0.00080.125230.0003
Fetch class attribute name0.00130.2031120.0001
XML
Image XML parsing0.00110.167930.0004
class_abstraction
Instantiating content class attribute0.00020.0300150.0000
General
dbfile0.00100.1579220.0000
String conversion0.00000.001640.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
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
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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