We are using O365/Sharepoint Online 2013 (+ Sharepoint Designer 2013).
We are using people search center as our intranet "Phone book" and it's working really well and I managed to customize the search hover panel (Item_Person_HoverPanel.html) so that some of the "extra information" fields are showing in the hover panel such as Past Projects and Schools and Skills.
What we would still like to add is Past Jobs so users could list their past employers/jobs and it would show in the hover panel.
I created a new property in Sharepoint Admin Center -> User Profiles -> User properties settings
I used the exact same settings for it as the default Past Projects -property has. Only difference being the property name as Past Projects is named SPS-PastProjects and I tried SPS-PastJobs but it gave me an error about the "-" so I just named the new property as "PastJobs".
After creating the property, I moved it up to the "Information" category so it would show respectively in the information -tab when a user is editing his/her profile.
Ok now users can see the Past Jobs -field when modifying their profiles and added Past Jobs are showing in their profile page after saving. Still when we go to our people search center and hover over a user, there is no Past Jobs -field to be seen in the hover panel. Here is what I have done after creating the property:
I checked out the people search center's display template "Item_Person_HoverPanel.html" and opened it in advanced editing mode in Sharepoint Designer
I added 'PastJobs';'PastJobs' to the managed properties -tag
Then I added a line for PastJobs in the list at the beginning like this:
var has_pj = !$isEmptyString(ctx.CurrentItem.PastJobs);
After that I copied the Past Projects -entry and modified all "PastProject" -words into "PastJobs" in that entry like this:
Copied this
<!--#_
if(has_pp == true) {
var encodedVal = Srch.U.getTrimmedProcessedHHXMLString(Srch.U.getMultipleHHXMLNodeValues(hhProps, "pastprojects", 5, delimiter), 145);
if (Srch.U.e(encodedVal)) { encodedVal = $htmlEncode(Srch.U.getTrimmedString(Srch.U.getUnEncodedMultiValuedResults(ctx.CurrentItem.PastProjects, 5, delimiter), 145)) }
if (!Srch.U.e(encodedVal)) {
infoAvailable = true;
_#-->
<li id="PastProjectsField">
<div class="ms-srch-hover-subTitle"><h3 class="ms-soften">_#= $htmlEncode(Srch.Res.hp_PeopleItem_PastProjects) =#_</h3></div>
<div class="ms-srch-hover-text" id="_#= $htmlEncode(id + HP.ids.peoplePastProjects) =#_">
_#= encodedVal =#_
</div>
</li>
<!--#_
}
_#-->
<!--#_
}
_#-->
And modified it like this:
<!--#_
if(has_pj == true) {
var encodedVal = Srch.U.getTrimmedProcessedHHXMLString(Srch.U.getMultipleHHXMLNodeValues(hhProps, "pastjobs", 5, delimiter), 145);
if (Srch.U.e(encodedVal)) { encodedVal = $htmlEncode(Srch.U.getTrimmedString(Srch.U.getUnEncodedMultiValuedResults(ctx.CurrentItem.PastJobs, 5, delimiter), 145)) }
if (!Srch.U.e(encodedVal)) {
infoAvailable = true;
_#-->
<li id="PastJobsField">
<div class="ms-srch-hover-subTitle"><h3 class="ms-soften">_#= $htmlEncode(Srch.Res.hp_PeopleItem_PastJobs) =#_</h3></div>
<div class="ms-srch-hover-text" id="_#= $htmlEncode(id + HP.ids.peoplePastJobs) =#_">
_#= encodedVal =#_
</div>
</li>
<!--#_
}
_#-->
<!--#_
}
_#-->
EDIT: I went into Sharepoint Online Admin Center -> Search -> Schema and I searched with the word "Past" for managed properties. It returned three results: owstaxIdPastJobs, owstaxIdSPShPastProjects and PastProjects but not PastJobs even as I named the new property as PastJobs when I created it in the user profile management -> user property management.. should there be PastJobs as well or is owstaxIdPastJobs enough (even though I have no idea where that name comes from)?
EDIT 2: It's been many days now (=should be indexed and crawled and so on) and I have noticed that we can't even search with the past jobs so I think there is something important missing from the property preventing it from used as a keyword in search?
EDIT 3: I created a new managed property called "PastJobs" and mapped it to the crawled property that was created automatically after the user profile property creation. Even after this I still cannot find any Past Jobs via search.
EDIT 4: Here are screenshots of our managed properties and crawled properties with the search keyword "Past".
I'm quite an amateur in these coding things so I will be really, really grateful for any help regarding this problem! :-)