How to print out the user account email ?

Author Message

laurent le cadet

Tuesday 12 July 2005 1:33:22 am

Hi,
I created a extand user accountwith several attributes and a user account attribute.

I can't manage to print the email of this attribute (which must be visible for all users).

I tried most of the methods without any result.

Someone can help me ?

Thank.

Laurent

Eivind Marienborg

Tuesday 12 July 2005 1:42:28 am

{$node.object.data_map.user_account.content.email}

This will give you the user account email adress in node, where the user account has identifier user_account. You might have to change it to suit your needs.

laurent le cadet

Tuesday 12 July 2005 2:04:43 am

Hi Eivind,

Thanks for replying but it doesn't work for me.

In fact I made an extension to make 2 differents kind of users able to register.

The module is a basic copy/paste of kernel/user and I rename it ancien_eleve.

That's where I am !

Eivind Marienborg

Tuesday 12 July 2005 2:59:22 am

Could you give an example of what code you already have tried to display the email?

Steve P

Tuesday 12 July 2005 3:15:42 am

Not being funny, did you do a fetch for your user?

Steve

laurent le cadet

Tuesday 12 July 2005 5:28:33 am

I tried :

{$content_version.data_map.user_account.content.email}
{$node.object.data_map.user_account.content.email}
{$node.contentobject_version_object.creator.data_map.user_account.content.email}

:(

Eivind Marienborg

Tuesday 12 July 2005 5:33:51 am

Would you mind pasting the entire template code here? It might be easier to resolve your problem if we can see the code in it's natural surroundings :)

laurent le cadet

Tuesday 12 July 2005 5:39:31 am

the template is really basic :

<div class="content-view-full">
    <div class="class-article">

        <h1>{attribute_view_gui attribute=$node.object.data_map.civilite} {attribute_view_gui attribute=$node.object.data_map.nom} {section show=$node.object.data_map.nom_marital.has_content}(n&eacute;e {attribute_view_gui attribute=$node.object.data_map.nom_marital}){/section} {attribute_view_gui attribute=$node.object.data_map.prenom}</h1>
        {section show=$node.object.data_map.photo.content}
            <div class="attribute-image">
                {attribute_view_gui attribute=$node.object.data_map.photo alignment=right image_class=medium}
            </div>
        {/section}
		

             Promotion : {attribute_view_gui attribute=$node.object.data_map.promotion}
			 <br />
			 <br />
			 <b>Informations personnelles</b>
			 <br />
			 Date de naissance : {attribute_view_gui attribute=$node.object.data_map.date_naissance}<br />
			 Lieu de naissance : {attribute_view_gui attribute=$node.object.data_map.lieu_naissance}<br />
			 Adresse : {attribute_view_gui attribute=$node.object.data_map.adresse}<br />
			 Code postal : {attribute_view_gui attribute=$node.object.data_map.code_postal}<br />
			 Ville : {attribute_view_gui attribute=$node.object.data_map.ville}<br />
			 Pays {attribute_view_gui attribute=$node.object.data_map.pays}<br />
			 T&eacute;l&eacute;phone : {attribute_view_gui attribute=$node.object.data_map.telephone}<br />
			 Mobile : {attribute_view_gui attribute=$node.object.data_map.mobile}<br />
		


			 E-mail : ###That's where I want to print the user account email###
			 


			 <br />
			 <br />
			 <b>Informations professionelles</b>
			 <br />
			 Entreprise : {attribute_view_gui attribute=$node.object.data_map.entreprise}<br />
			 Adresse : {attribute_view_gui attribute=$node.object.data_map.adresse_entreprise}<br />
			 Code postal : {attribute_view_gui attribute=$node.object.data_map.code_postal_entreprise}<br />
			 Ville : {attribute_view_gui attribute=$node.object.data_map.ville_entreprise}<br />
			 Pays : {attribute_view_gui attribute=$node.object.data_map.pays_entreprise}<br />
			 E-mail entreprise : {attribute_view_gui attribute=$node.object.data_map.email_entreprise}<br />
			 T&eacute;l&eacute;phone : {attribute_view_gui attribute=$node.object.data_map.telephone_entreprise}<br />
			 Fax : {attribute_view_gui attribute=$node.object.data_map.fax}<br />
			 Site internet : {attribute_view_gui attribute=$node.object.data_map.site_internet}<br />
			 Secteur d'activit&eacute; : {attribute_view_gui attribute=$node.object.data_map.secteur}<br />
			 Profil : {attribute_view_gui attribute=$node.object.data_map.profil}<br />
			 Salaire : {attribute_view_gui attribute=$node.object.data_map.salaire} &euro;<br />
			 <br>
			 <br>

			 		        {section show=$node.object.can_edit}
        <form method="post" action={"content/action/"|ezurl}>
        <input type="hidden" name="ContentObjectID" value="{$node.object.id}" />
        <input class="button forum-edit-reply" type="submit" name="EditButton" value="{'Edit'|i18n('design/standard/node/view')}" />

        </form>
        {/section}<br>


        <div class="attribute-tipafriend">
          <p>
             <a href={concat('/content/tipafriend/',$node.node_id)|ezurl}>{"Tip a friend"|i18n("design/base")}</a>
          </p>
        </div>

    </div>
</div>

Eivind Marienborg

Tuesday 12 July 2005 5:50:30 am

What version eZ Publish are you running? {$node.object.data_map.user_account.content.email} should work on 3.6, at least..

laurent le cadet

Tuesday 12 July 2005 6:03:03 am

3.5.2

Eivind Marienborg

Tuesday 12 July 2005 6:05:33 am

Have you tried a {$node|attribute(show)} to see the list of all attributes?

laurent le cadet

Tuesday 12 July 2005 6:13:27 am

yes but only the 3 titles are printed the attributes are not listing (!!)

Eivind Marienborg

Tuesday 12 July 2005 6:24:23 am

What template are you overriding with this?

laurent le cadet

Tuesday 12 July 2005 6:27:40 am

the node/view/full.tpl

Eivind Marienborg

Tuesday 12 July 2005 6:33:16 am

Well, then I'm all outta ideas. Anyone else?

Steve P

Tuesday 12 July 2005 6:45:18 am

Can you post the output from {$node|attribute(show)}?

laurent le cadet

Tuesday 12 July 2005 7:05:12 am

wow !

here's some content :

Attribute Type Value 
node_id string 372 
parent_node_id string 316 
main_node_id string 372 
contentobject_id string 474 
contentobject_version string 2 
contentobject_is_published string 1 
depth string 3 
sort_field string 2 
sort_order string 0 
priority string 0 
modified_subnode string 1121091513 
path_string string '/1/5/316/372/' 
path_identification_string string 'utilisateurs/anciens_eleves/le_cadet_laurent' 
remote_id string '73f01ca8fd46dbf93935905b778adf3d' 
is_hidden string 0 
is_invisible string 0 
name string 'Le Cadet Laurent' 
data_map array Array(28) 
>civilite object[ezcontentobjectattribute] Object 
>nom object[ezcontentobjectattribute] Object 
>nom_marital object[ezcontentobjectattribute] Object 
>prenom object[ezcontentobjectattribute] Object 
>promotion object[ezcontentobjectattribute] Object 
>date_naissance object[ezcontentobjectattribute] Object 
>lieu_naissance object[ezcontentobjectattribute] Object 
>adresse object[ezcontentobjectattribute] Object 
>code_postal object[ezcontentobjectattribute] Object 
>ville object[ezcontentobjectattribute] Object 
>pays object[ezcontentobjectattribute] Object 
>telephone object[ezcontentobjectattribute] Object 
>mobile object[ezcontentobjectattribute] Object 
>entreprise object[ezcontentobjectattribute] Object 
>adresse_entreprise object[ezcontentobjectattribute] Object 
>code_postal_entreprise object[ezcontentobjectattribute] Object 
>ville_entreprise object[ezcontentobjectattribute] Object 
>pays_entreprise object[ezcontentobjectattribute] Object 
>email_entreprise object[ezcontentobjectattribute] Object 
>telephone_entreprise object[ezcontentobjectattribute] Object 
>fax object[ezcontentobjectattribute] Object 
>site_internet object[ezcontentobjectattribute] Object 
>secteur object[ezcontentobjectattribute] Object 
>profil object[ezcontentobjectattribute] Object 
>salaire object[ezcontentobjectattribute] Object 
>photo object[ezcontentobjectattribute] Object 
>compte_utilisateur object[ezcontentobjectattribute] Object 
>non_email object[ezcontentobjectattribute] Object 
object object[ezcontentobject] Object 
>id string 474 
>section_id string 9 
>owner_id string 14 
>contentclass_id string 31 
>name string 'Le Cadet Laurent' 
>is_published string 0 
>published string 1121090437 
>modified string 1121091513 
>current_version string 2 
>status string 1 
>remote_id string '73f01ca8fd46dbf93935905b778adf3d' 
>current object[ezcontentobjectversion] Object 
>versions array Array(3) 
>author_array array Array(2) 
>class_name string 'Ancien élève' 
>content_class object[ezcontentclass] Object 
>contentobject_attributes array Array(28) 
>owner object[ezcontentobject] Object 
>related_contentobject_array array Array(0) 
>related_contentobject_count string 0 
>reverse_related_contentobject_array array Array(0) 
>reverse_related_contentobject_count string 0 
>can_read boolean true 
>can_create boolean true 
>can_create_class_list array Array(3) 
>can_edit boolean true 
>can_translate boolean true 
>can_remove boolean false 
>can_move boolean true 
>data_map array Array(28) 
>main_parent_node_id string 316 
>assigned_nodes array Array(1) 
>parent_nodes array Array(1) 
>main_node_id string 372 
>main_node object[ezcontentobjecttreenode] Object 
>default_language string 'fre-FR' 
>content_action_list boolean false 
>class_identifier string 'ancien_eleve' 
>class_group_id_list array Array(1) 
>match_ingroup_id_list boolean false 
subtree array Array(0) 
children array Array(0) 
children_count string 0 
contentobject_version_object object[ezcontentobjectversion] Object 
>id string 1215 
>contentobject_id string 474 
>creator_id string 474 
>version string 2 
>status string 1 
>created string 1121091502 
>modified string 1121091502 
>workflow_event_pos string 0 
>user_id string 0 
>creator object[ezcontentobject] Object 
>name string 'Le Cadet Laurent' 
>version_name string 'Le Cadet Laurent' 
>main_parent_node_id string 316 
>contentobject_attributes array Array(28) 
>related_contentobject_array array Array(0) 
>reverse_related_object_list array Array(0) 
>parent_nodes array Array(1) 
>can_read boolean false 
>data_map array Array(28) 
>node_assignments array Array(1) 
>contentobject object[ezcontentobject] Object 
>language_list array Array(1) 
>translation object[ezcontentobjecttranslation] Object 
>translation_list array Array(0) 
>complete_translation_list array Array(1) 
>temp_main_node object[ezcontentobjecttreenode] Object 
sort_array array Array(1) 
>0 array Array(2) 
can_read boolean true 
can_create boolean true 
can_edit boolean true 
can_hide boolean false 
can_remove boolean false 
can_move boolean true 
creator object[ezcontentobject] Object 
>id string 474 
>section_id string 9 
>owner_id string 14 
>contentclass_id string 31 
>name string 'Le Cadet Laurent' 
>is_published string 0 
>published string 1121090437 
>modified string 1121091513 
>current_version string 2 
>status string 1 
>remote_id string 'd58b10a7ad30ed6e2315c4bde53dae65' 
>current object[ezcontentobjectversion] Object 
>versions array Array(3) 
>author_array array Array(2) 
>class_name string 'Ancien élève' 
>content_class object[ezcontentclass] Object 
>contentobject_attributes array Array(28) 
>owner object[ezcontentobject] Object 
>related_contentobject_array array Array(0) 
>related_contentobject_count string 0 
>reverse_related_contentobject_array array Array(0) 
>reverse_related_contentobject_count string 0 
>can_read boolean true 
>can_create boolean true 
>can_create_class_list array Array(3) 
>can_edit boolean true 
>can_translate boolean true 
>can_remove boolean false 
>can_move boolean true 
>data_map array Array(28) 
>main_parent_node_id string 316 
>assigned_nodes array Array(1) 
>parent_nodes array Array(1) 
>main_node_id string 372 
>main_node object[ezcontentobjecttreenode] Object 
>default_language string 'fre-FR' 
>content_action_list boolean false 
>class_identifier string 'ancien_eleve' 
>class_group_id_list array Array(1) 
>match_ingroup_id_list boolean false 
path array Array(2) 
>0 object[ezcontentobjecttreenode] Object 
>1 object[ezcontentobjecttreenode] Object 
path_array array Array(4) 
>0 integer 1 
>1 integer 5 
>2 integer 316 
>3 integer 372 
parent object[ezcontentobjecttreenode] Object 
>node_id string 316 
>parent_node_id string 5 
>main_node_id string 316 
>contentobject_id string 379 
>contentobject_version string 1 
>contentobject_is_published string 1 
>depth string 2 
>sort_field string 2 
>sort_order string 0 
>priority string 0 
>modified_subnode string 1121091513 
>path_string string '/1/5/316/' 
>path_identification_string string 'utilisateurs/anciens_eleves' 
>remote_id string 'da4d410a1966a453b4a14de489f3c69b' 
>is_hidden string 0 
>is_invisible string 0 
>name string 'Anciens élèves' 
>data_map array Array(2) 
>object object[ezcontentobject] Object 
>subtree array Array(1) 
>children array Array(1) 
>children_count string 1 
>contentobject_version_object object[ezcontentobjectversion] Object 
>sort_array array Array(1) 
>can_read boolean false 
>can_create boolean true 
>can_edit boolean false 
>can_hide boolean false 
>can_remove boolean false 
>can_move boolean false 
>creator object[ezcontentobject] Object 
>path array Array(1) 
>path_array array Array(3) 
>parent object[ezcontentobjecttreenode] Object 
>url string 'utilisateurs/anciens_eleves' 
>url_alias string 'utilisateurs/anciens_eleves' 
>class_identifier string 'user_group' 
>class_name string 'User group' 
>hidden_invisible_string string '-/-' 
>hidden_status_string string 'Visible' 
url string 'utilisateurs/anciens_eleves/le_cadet_laurent' 
url_alias string 'utilisateurs/anciens_eleves/le_cadet_laurent' 
class_identifier string 'ancien_eleve' 
class_name string 'Ancien élève' 
hidden_invisible_string string '-/-' 
hidden_status_string string 'Visible' 

Steve P

Tuesday 12 July 2005 7:45:48 am

Blimmy as they say over here ;-)

That "looks" correct to me - can't you print values with {$your_fetch_var.contentobject.civilite.value} for example?

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 31 2025 04:14:02
Script start
Timing: Jan 31 2025 04:14:02
Module start 'layout'
Timing: Jan 31 2025 04:14:02
Module start 'content'
Timing: Jan 31 2025 04:14:02
Module end 'content'
Timing: Jan 31 2025 04:14:02
Script end

Main resources:

Total runtime0.0143 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0044 588.2500151.2266
Module start 'layout' 0.00440.0027 739.476636.6797
Module start 'content' 0.00710.0059 776.1563122.3125
Module end 'content' 0.01300.0012 898.468861.9922
Script end 0.0142  960.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002114.7035140.0001
Check MTime0.00106.8120140.0001
Mysql Total
Database connection0.00085.383010.0008
Mysqli_queries0.002618.462130.0009
Looping result0.00000.070210.0000
Template Total0.00096.310.0009
Template load0.00074.885010.0007
Template processing0.00021.345310.0002
Override
Cache load0.00053.482910.0005
General
dbfile0.002215.154880.0003
String conversion0.00000.036840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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