Forums / Setup & design / How to print out the user account email ?

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?