Share » Forums » Developer » Attend a event

Attend a event

Attend a event

Friday 30 January 2009 5:14:27 am - 3 replies

Author Message

Kristof Coomans

Friday 30 January 2009 6:17:03 am

Hi Steffen

You can do this in the template, by fetching the "attend" objects that have the current user as owner. If the count of the results is 0, you can show the create button, otherwise you can show the current object together with an "edit" button or link.

See http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/list#eztoc87605_0_0_1, under "Filtering on a non-attribute". The current user you can fetch with the user/current_user fetch function, see http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/user/fetch_functions/current_user.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Steffen Amundsen

Friday 30 January 2009 6:50:44 am

Thanks.

I am kind a new to Ez, but I try this so far:

 {def $count=fetch( 'content', 'list_count', hash( 'parent_node_id', $node.node_id ) )}

{section show=$count|gt(0)}
 some form here..
{/section}

Now how to test for which user?

Steffen Amundsen

Friday 30 January 2009 7:21:02 am

I think I got it:

{def $user=fetch( 'user', 'current_user' )}
{def $count=fetch( 'content', 'list_count', hash( 
			'parent_node_id', $node.node_id,
			'attribute_filter',$user,
			depth,2,
            class_filter_type, include,
            class_filter_array, array( 'attend' )) )}

{section show=$count|gt(0)}
har meldt på
{section-else}
har ikke
{/section}

Thanks

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu