Current user keyword


(L5x12w19) #1

is there a keyword that calls the current user's id?


%globals_current_user_id% wont work


(Vsterling) #2

%globals_current_user_attribute_id% or maybe %globals_user_attribute_id%. Just guessing by the Concept Manual.


(Nic Hubbard) #3

[quote]is there a keyword that calls the current user's id?


%globals_current_user_id% wont work[/quote]



Did you try something like %globals_user_id%?


(Vsterling) #4

I think I got this one Nic... now go answer my post! :ph34r:

(Nic Hubbard) #5

Ok guys, the correct keyword is:

    %globals_user_assetid%


Another cool thing I realized is you can access the current users metadata as well. I can see great potential with this, building custom user settings into Simple Edit! Hooray!

    %globals_user_metadata_XXX%

(L5x12w19) #6

[quote]Ok guys, the correct keyword is:

    %globals_user_assetid%


Another cool thing I realized is you can access the current users metadata as well. I can see great potential with this, building custom user settings into Simple Edit! Hooray!

    %globals_user_metadata_XXX%
[/quote]


%globals_user_assetid% works.. thanks nnhubbard.. the ironic part is i cant use global keywords in the edit layout.. :lol:

Thanks all

(Vsterling) #7

[img]http://1.bp.blogspot.com/_uk-NIeC1F5g/R_r1P3Vts0I/AAAAAAAAAzo/0i1xSPJFJjQ/s320/charlie-brown-argh.jpg[/img]
Okay you win this round...

(Nic Hubbard) #8

[quote]%globals_user_assetid% works… thanks nnhubbard… the ironic part is i cant use global keywords in the edit layout… :lol:


Thanks all[/quote]



You talking about Simple Edit? Globals keywords were not added to Simple Edit until some 3.18.x version.


(L5x12w19) #9

yeah im working on a v 3.16

(Nic Hubbard) #10

Yeah, Globals keyword replacements won't work in Simple Edit then.

(Daniel Nitsche) #11

[quote]Ok guys, the correct keyword is:

    %globals_user_assetid%


Another cool thing I realized is you can access the current users metadata as well. I can see great potential with this, building custom user settings into Simple Edit! Hooray!

    %globals_user_metadata_XXX%
[/quote]

Nice one Nic!

I've added these to the list:
http://matrixsecrets.com/2009/02/mysource-keywords

(Justin Cormack) #12

[quote]Nice one Nic!


I’ve added these to the list:

http://matrixsecrets.com/2009/02/mysource-keywords[/quote]



%globals_user %globals_site and %globals_asset all take any asset keywords - so you can access site metadata etc too if you want to store some site specific config values for example. As you can apply metadata sections by asset type you can use the same schema and add sections to use via these keywords.


(Peter Sheppard) #13

Is %globals_user_X% supposed to work in email bodies sent via triggers?


I want to send the currently logged in user (who caused the trigger)'s asset id and fullname in an email, but can't seem to get the keywords right!


(Nic Hubbard) #14

[quote]Is %globals_user_X% supposed to work in email bodies sent via triggers?


I want to send the currently logged in user (who caused the trigger)'s asset id and fullname in an email, but can't seem to get the keywords right![/quote]



What are your events? If you use something like user login, then the following keywords will work:


    %asset_attribute_username% (%asset_attribute_first_name% %asset_attribute_last_name%)

(Peter Sheppard) #15

[quote]What are your events? If you use something like user login, then the following keywords will work:

    %asset_attribute_username% (%asset_attribute_first_name% %asset_attribute_last_name%)
[/quote]

No, the event is Asset Status Changed (to live)