Output User firstname lastname as link to profile in Drupal 7 views - drupal-7

In Drupal 7, I'm trying to output a list of users related to a node in a view, which I've got working fine.
However, the only way to link to the user profile is to use the user:name field in views, which gives me the markup
username.
I've got two additional profile fields, user:Firstname and user:Lastname, but can't see to find a way to do this:
[user:firstname] [user:lastname]
as each time I try and rewrite the output of the link, it refuses to work; user:url doesn't exist as option in my views UI (which contains the link I need according to Devel).
Thoughts?

I've not used it. But my educated guess is that the easiest solution for you would be to look at the realname module, which should do all the heavy lifting for you.

Related

mgt-react PeoplePicker defaultSelectedUsers not working as I would expect

I've been writing a React app that relies on the mgt-react components.
The app is basically just an interface to a SharePoint library.
Everything has been working great and the PeoplePicker is working in so much as I can start typing a users name and the drop down works and I can select a person.
However now I'm at the point where I want to create an edit screen. In order to implement this I need to prepopulate the PeoplePicker with the users that were input at insert time.
I can't seem to get the "defaultSelectedUsers" property to work.
I've pared things down to simply hardcoding a users email address and it still doesn't work.
Here is my code for the component (email address changed for privacy reasons):
<PeoplePicker defaultSelectedUsers={['user#domain.com']} selectionMode="single" selectionChanged={handleSelectionChanged}></PeoplePicker>
No matter what I do it is not prepopulating with a user / person.
The permissions are all there (I think) which is proven by the component working when I start typing a user name.
Any ideas what I might be missing?
As always thanks so much for any input in advance.
----- edit ----
Oh okay, it seems that I can't use that prop with mgt-react? I have to use defultSelectedUserIds and can't just provide an email address. Can someone confirm this is the case?
Is there mgt documentation for the defaultSelectedUsers property? As far as I am aware, the people picker only supports defaultSelectedUsersById. The email address should work though, assuming the graph is able to retrieve the users (it's their actual id).
For a quick test, are you able to retrieve the users through the graph explorer with the /users/${id} (replace id with your email) filter? This is what we use for the property.

Get content Id (nid) from path on views block

I just can't seem to wrap my head around Drupal relationships. I have been reading and watching tutorials, but as soon as I try to get my own project done - I fail. I think it's very basic, so I would love to understand it. Maybe someone here can help me understand how it works :)
On my drupal site, I want to keep track of some private game tournaments.
I have created a content type called contestant, which has fields like: Tournament date, Player name, Final Position. I can then create a view that list the information from one tournament. I used the help I got from this thread: drupal views dynamic filter
I would like to have the view described above as a block. And then place that block-view on a "tournament description" page. I could do this, by simply creating a new block each time, and then manually place it on the page it should be shown (structure-->Blocks-->configure), but that is not an elegant way to do it. I am pretty sure this is where Relationships should be used. But I fail to understand how to create this relationship, so that the specific block view, that matches the specific tournament description page will be displayed together.
Use a Content:Nid as a Contextual filter.
WHEN the Filter value is not in the URL >>
Provide default value
Content ID from URL

CRM 2011 Search Exact Match

I have a problem with CRM 2011 , I currently have 22 users . In the Accounts or Cases entities some of them can search with half of the word and some of them have to enter the whole exact name to get answers which is really annoying . Can someone help please?
Thank You !
By default you can add which fields will be searched to the Quick Search view, see how Example.
You still can use wild cards "*" (ex: "John") when performing a Quick Find Search.
Make sure they use all the same view (the Quick find one usually) and, from
Settings->Customizations->Customize the system->Entities->(Select the desired entity)->Views and then open the view users are using then you can set the filter criteria to whatever you would like for each fields.
I don't think you can enforce a view on users though, but my guess if for some users partial searches work, and for some others not, they are probably using different views.
EDIT: You can select said view and in More Actions above set it to default view. Then again, users are still able to create personal views and set them as default...
Surely you mean that your users search their wanted fields in quick find area that this is system view and the problem posed do not have relation to view's setting, because it was the same for all the user's.
so i guess this problem arises out: keyboard not uniform.......

Show Opportunity related Contacts in Custom Object Field

I have the next issue.
I have a custom object called 'Application', and I have this requirement:
"Show all Contacts related to an Application. Create a field on Application object, must be read only".
I solve it with apex code. 'Application' has a lookup to Opportunity, Opportunity to Account, and all my contacts have AccountId, so this way, I get all the contacts using apex code in a trigger.
But, I've been ask to change this to a Formula field in Application object.
So, my issue is next. I'm not able to get all contacts with advance formula editor, because they're not part of any object. I have no master-detail relationship.
Does any one know how can I achieve this using configuration? I should not use apex code for this req.
Thank in advance guys.
I don't think you can do it.
In formulas / merge fields syntax there's no way to go "up, up then down" (Application -> Opportunity -> Account -> down to Contacts related list). There's also nothing that would let you loop through Contacts (and display what? Ids? Names? Emails?). Roughly speaking you can only go up through dots.
You might want to explore path of "cross object workflow" rules but I imagine that when I add a new Contact to Account it should somehow "spread itself" to all related Applications? There's no straight way to fire a workflow on delete too - so you'd eventually end up with inaccurate list.
I'd say trigger was a good solution. Maybe it ws unoptimized but if it has to be in a field - tough.
There might be a fairly simple way of achieving that by embedding a visualforce page within Application page layout.
This should be doable with pure Visualforce (so technically there will be no Apex code ;))
Something as simple as
<apex:relatedList list="Contacts" subject="Application__c.Opportunity__r.AccountId" />
would be a good start (if you want your own layout and not a rel. list - you should be still able to pull it off with <apex:repeat> or <apex:pageBlockTable>.
There's one BUT here: it's not a field, just a display trick. Forget about using it in reports, mobile applications etc.
Another way - would it be acceptable to be 1 click away from these contacts? You could make a report "Account with Contacts", filter it by Id of one Account and later use "URL hacking" to change the filter depending on from which Application you'll click it. This link could be either a formula field or a real custom button/link. Technically - it's pure config, no apex & VF.
You can read more about URL hacking at Ray Dehler's excellent post and specifically about dynamic Reports here or here.

DotNetNuke Switching Between Multple Edit Modules

I have a custom module in DNN 7 that has a data structure where items belong to categories (called "sections", not DNN taxonomy, just a simple list of section names). The module edit screens work so that on the view control you may click on an edit link on each category, which loads the category edit screen (passing the category id). This works great, and when you save I use Globals.NavigateURL() to return to the view screen. This all works as intended.
On each category edit screen I also have a list of the items within that category, each with an edit link. Clicking the edit link opens the item edit screen, passing the correct item id, and allowing me to edit that item. This all works great, until you save. The save works properly, but when I want to send the user back to the edit screen for the category it doesn't work. When I use:
Response.Redirect(EditUrl("SectionId", sectionid.ToString(), "EditSections"), true);
...nothing happens. It simply doesn't redirect anywhere. This is exactly the same URL I'm using to get to the category edit page in the first place:
EditUrl("SectionId", Eval("SectionId").ToString(), "EditSections")
And then I use a similar URL to get to the item edit page:
EditUrl("ItemId", Eval("ItemId").ToString(), "EditItems")
I don't understand why using the same URL to navigate to the same page I already navigated to would simply not do anything. For now I am sending them all the way back to the view, but it's painful if you need to add several items to the same category to have to navigate back into the category and add another item, only to be sent back to the view.
Anyone see anything like this before?
Have you tried to use the overload of NavigateUrl instead of EditUrl?
Globals.NavigateURL(TabId, "EditSections", "mid", ModuleId.ToString(), "SectionId", Eval("SectionId").ToString())
I haven't seen that myself but I would have to assume that somehow the context is being lost with EditURL and you're not getting sent to the proper location due to that.
I would suggest you try one of two things (or both).
Debug the URL that EditURL is returning and see if you can find the
difference.
Use NavigateURL for all your links and pass in MID=## for your
moduleid as a querystring parameter, to ensure that the proper
values are being passed.
UPDATE: If you're trying to have multiple edit views, and move between them, you might look at using a "loader" instead of having separate module definitions for the edit controls. Basically have a single Edit.ascx file defined, and it loads other ASCX files within it, injecting into a Panel. The View control on this module http://dnnsimplearticle.codeplex.com/ does that, but I haven't tried it with an edit control before.

Resources