ADFS transform custom attribute - adfs

I'm trying to figure out how to do a "transform Claim Rule" sending the attribute extensionAttribute1 which we use as the office for users in Active Directory. Do I just type in "extensionAttribute1" in the INcoming claim type: field?

Yes - those "drop-down" fields are in fact editable.
In the claim you want isn't in the dropdown, just type it in.

Related

Field enabled based on role

I'm struggling to get a field to be enabled and/or visible based on user's role in Google App Maker.
I'm assigned to the Admins role and am trying to get the field to enable and/or visible if an Admin is the user of the page.
On the object i've added the below to the enabled and visible option
#user.roles ? "Admins"
but it's permenantly disabled. I've tried testing as both preview and published versions. I've also tried seeing it as #user.roles ? Admins and it still stays disabled.
Any ideas?
It should be (#user.roles).indexOf('Admins') > -1. Bracket placement seems to be very particular when using visibility or enabled when using a binding in app maker.
Try to set binding to:
(#user.roles).indexOf('Admins') > -1

Drupal 7 get node reference custom field in path auto pattern

In drupal I have 2 content type "events" and "news". news content type have a node reference field "field_associated_event" to select events from events content type. events have also 2 another field text field "field_url_one" and "field_url_two"
In path auto pattern for events
[node:field_url_one]/[node:field_url_two]/events
For news url I want to get this but it's not working
[node:field_url_one]/[node:field_url_two]/news/{news alias} - not working
at give result in url only : news/{news alias}
I have using entity, entity reference module but not get token to reference fields. It get only event title if I used
[node:field_associated_event]/news/{news alias}
It works fine and get event title in url.
How to get event fields in url for news page?
You need to install Entity tokens module (comes with Entity module). Then you will be able to use [node:field-associated-event:field_url_one] and [node:field-associated-event:field_url_two] tokens in your path patterns.
Note using hyphen instead of underline (i.e. correct is [node:field-associated-event], NOT [node:field_associated_event]).

drupal 7 display user info for current user

I need to display name, role, photo of current user.
I'm use views, in Advanced settings add Contextual filters select Content: Author uid and in settings of it select Provide default value ,in type selectbox choose User ID from logged in user.
But in fields i haven't field 'user:name'.
If i create relationship content : author , user name will be displayed, but only for users, that published node.
At the end, i want see like this
Hello, SmithJN
Role: Authorised user
Photo: [photo]
When you create the view, at the very first screen, you have the option to select the entity type on which you want to create the view. (thank J.Reynolds)
Then in Fields add Field Name, Role, Image In Fileter Criteria add filter User : current
It's all !

Drupal 7: how to filter view content (with entity reference field) based on current page content

in my drupal 7 I have 2 content-types like these:
ContentA
ContentB (with a field Entity Reference to ContentA)
In the front-end detail page of ContentA, I would love to show a block/view with a list of ContentB whose Entity Reference field is set to the current ContentA.
I made a view of type Block and added it correctly to the page, but I cannot filter ContentB based on the current ContentA.
Could you help me?
Thanks
You should add a contextual filter for the value you will use for filtering to the block View of ContentB.
Then in your contextual filter in the "When the filter value is NOT in the URL" area select "Provide default value" and Type "PHP code" (You should have enable php filter for this). In your php code area you should have the following code
$node=menu_get_object();
return $node->field_your_machine_field_name['und'][0]['target_id']; // this is the field you will use for fitlering
Hope it helps
UPDATE
The above code will work if you need to show in your block similar results with the same selection (for example similar results of ContentB with the same selection in the referencing field of ContentA ).I will not delete because you might need it also in your project.I misunderstood. Actually the solution is simpler. You should add the contextual filter to the field and in "When the filter value is NOT in the URL" area select "Provide default value" and "Provide id from url"

How to show wordpress setting api validation error message?

I have created a setting api for my new plugin. It has four <input> field and one <select> option. In that field , user can change value according to their requirement. But it must be valid value. Suppose , one <input> field support only integer value. so when user will fill that <input> field by string or by other things, it will show an error message. Please tell me how can i do that? Can you suggest any tutorial ?
When using add_setting you can pass a sanitize_callback option as part of the array, this can contain the name of a function that is run which can contain your validation.
A similar method exists for JavaScript too, which you could use to validate the fields as well.
You asked for a tutorial too, here is one that outlines the method I've described: http://themeshaper.com/2013/04/29/validation-sanitization-in-customizer/

Resources