Forums / Install & configuration / Finding the email-adress...

Finding the email-adress...

Author Message

Atle Enersen

Sunday 19 January 2003 2:42:01 am

I have a full_class_*.tpl for an article content object that shall display both the authors name and email-adress. The authors name is no problem, this is found via the {$content_object.owner.name} (or {$node.object.owner.name} if one prefers) but how the he.. do I find the rest of the userdata (from ezuser) for the owner/creator...?

As I understand the owner.name refers to ezcontentobject (in the DB) referred from the ower_id field - yes, I looked in the DB-structure. In this case the author will allways be the one that has written the article.

So, how to get the data from the table ezuser where the email-adress is stored?

\atle\
--

Luc Chase

Thursday 16 October 2003 5:13:59 am

Atle,
did you ever solve this?? I really need the solution to this also.

The Web Application Service Provider

Paul Borgermans

Thursday 16 October 2003 6:52:28 am

This is what I use in a line view template:

$node.contentobject_version_object.creator.contentobject_attributes.2.content.email}

Sometimes you have to dig deep ;-)

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Luc Chase

Thursday 16 October 2003 7:26:44 am

It worked!! Thank you!
Can you explain how one should normally find these things? What should I have been looking at to find that attribute on my own? So that when I need something else I can try to help myself.

The Web Application Service Provider

Paul Borgermans

Thursday 16 October 2003 8:41:08 am

{$node|attribute(show,<level>)}

With <level> set to a large depth, the default is 2 (large output too, you're warned)

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Luc Chase

Thursday 16 October 2003 9:34:34 am

Tres Cool! Thanks.

The Web Application Service Provider

Jan Borsodi

Friday 17 October 2003 12:56:32 am

A better way of accessing the user data is to trough the data_map attribute, the data_map will return an array with all content attributes where the content attribute identifier is the lookup name, in this case it's user_account which is defined by the User content class.

The line would then be
{$node.contentobject_version_object.creator.data_map.user_account.content.email}

Some more info on the data_map can be read here:
http://ez.no/developer/ez_publish_3/documentation/customization/custom_design/node

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Luc Chase

Saturday 18 October 2003 12:31:26 am

Jan, your method seems easier but when you say 'better' do you mean that it is more reliable? Would the two methods allways return the same value or are their circumstances that would cause them to return a different value? For example, is one the email of the creator (of the first version) and the other the email of the last editor (creator of the current version)?
I'm trying to use this in each item of the shop basket so that I can send an email to {$basket.items.....contentobject_version_object.creator.data_map.user_account.content.email}

The Web Application Service Provider

Luc Chase

Saturday 18 October 2003 12:58:04 am

Eureka!!!!
{$Basket:ProductItem:item.item_object.contentobject.main_node.contentobject_version_object.creator.data_map.user_account.content.email}
or
{$Basket:ProductItem:item.item_object.contentobject.main_node.contentobject_version_object.creator.contentobject_attributes.2.content.email}
Thanks to Paul and Jan!... now how to e-mail the order (including header details) with only this item....

The Web Application Service Provider

Paul Forsyth

Saturday 18 October 2003 4:09:03 am

With lines of this length its a good idea to create some useful variables:

{let my_datamap=$Basket:ProductItem:item.item_object.contentobject.main_node.contentobject_version_object.creator.data_map}

{$my_datamap.user_account.content.email}
{$my_datamap.others...}
{/let}

With the second example you can be neater:

{let my_attributes=$Basket:ProductItem:item.item_object.contentobject.main_node.contentobject_version_object.creator.contentobject_attributes}

{attribute_view_gui attribute=$my_attributes.2.content.email}

{/let}

and so on.

Saves using scroll bars ;)

paul

Luc Chase

Saturday 18 October 2003 5:30:13 am

Do you think there is a simple way to send an email to the 'creator/owner' of the item in the basket (along with the order header i.e. who is ordering it.)?

The Web Application Service Provider

Jan Borsodi

Wednesday 22 October 2003 5:18:51 am

> Jan, your method seems easier but when you say 'better' do
> you mean that it is more reliable?

Yes, the first one relies on the order/placement of the attribute while the second (data_map) relies on the name of the attribute. Order/placement may change but the identifer name rarely change (if ever).
The other advantage with identifier names is that you can use the same identifier in multiple classes and just have one template for all of them (or PHP code for that matter).

Generally you shouldn't change the identifier name (You can still change the displayed name) in a class once objects has been made from it, that ensures that your templates don't need any changes to them.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

eZ debug

Timing: Jan 18 2025 03:11:57
Script start
Timing: Jan 18 2025 03:11:57
Module start 'content'
Timing: Jan 18 2025 03:11:58
Module end 'content'
Timing: Jan 18 2025 03:11:58
Script end

Main resources:

Total runtime1.2756 sec
Peak memory usage4,096.0000 KB
Database Queries227

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.7344180.8281
Module start 'content' 0.00551.1431 768.5625759.4688
Module end 'content' 1.14860.1270 1,528.0313353.3359
Script end 1.2756  1,881.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.3121210.0002
Check MTime0.00150.1187210.0001
Mysql Total
Database connection0.00070.053210.0007
Mysqli_queries1.182792.71542270.0052
Looping result0.00220.17352250.0000
Template Total1.245397.620.6226
Template load0.00220.169720.0011
Template processing1.243197.449820.6216
Template load and register function0.00010.010510.0001
states
state_id_array0.00120.091110.0012
state_identifier_array0.00080.063020.0004
Override
Cache load0.00190.1512650.0000
Sytem overhead
Fetch class attribute can translate value0.00160.123460.0003
Fetch class attribute name0.00150.1170140.0001
XML
Image XML parsing0.00180.137760.0003
class_abstraction
Instantiating content class attribute0.00000.0021160.0000
General
dbfile0.00380.3010350.0001
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
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 45
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs