Source: site.view [edit]
Function name: favoritePerson
Arguments: personId
Description: Remembers a favorite person
Page type: html
Render function:   searchRender
Module: collabExt

Page source:

<h1>Save Favorite</h1>

<webl>
   // just saves in memory for now, might want to persist
   var favorites = wubvars.favoritePeople ? { };
   favorites = favorites + { personId };
   wubvars.favoritePeople := favorites;
   "";
</webl>

<h2>Favorite Saved.</h2>

<webl>
var res = "";
res = res + "<h1>Saved Favorites</h1>\n";

res = res + "<table>\n";
var people = (ToList(wubvars.favoritePeople) ? []);
every personId in people do
   var person = WubCall("cmdPersonProfile", [personId]);
   if person != [. .] then
      res = res + `<tr><td><a target="_blank" href="/webl/WubHub_DoIt?cmdline=cmdPersonProfile(` + person["id"] + ")" + 
             `">` + person["name"] + `</a></td>` +
             `<td>` + person["headline"] + `</td> ` +
             `<td> (<a href="/webl/WubHub_DoIt?cmdline=similarPerson(` + person["id"] + `)">find similar</a>)</td>` +
             `<td> (<a href="/webl/WubHub_DoIt?cmdline=removeFavorite(` + person["id"] + `)">remove favorite</a>)</td> </tr>`;
   end
end;
res;
</webl>