- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 01:39 AM
Hi guys how can we add the current user's name to the "How Can We Help?" message on the main SP page? Please refer to attached screenshot. Thanks - Regina
Solved! Go to Solution.
- Labels:
-
User Interface (UI)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 05:04 AM
For the newly cloned widget...
Just write the below line in the Server part:
data.user = gs.getUserName();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2017 08:55 AM
Any help on how I can get this to use the first name from the sys_user table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-23-2017 08:57 AM
Hi Allison,
Try this in your new widget and let me know if it works for you:
Try this in your Client Script:
function() {
//Add greeting based on time of day and add user's first name
var c = this;
var today = new Date()
var curHr = today.getHours()
if (curHr < 12) {
c.data.greeting = 'Good morning ' + scope.user.first_name;
} else if (curHr < 18) {
c.data.greeting = 'Good afternoon ' + scope.user.first_name;
} else {
c.data.greeting = 'Good evening ' + scope.user.first_name;
}
}
Your HTML Template should look like this:
<div id="homepage-search" class="hidden-xs wrapper-xl">
<div class="wrapper-xl">
<h1 class="text-center text-3x m-b-lg sp-tagline-color" ng-bind="data.greeting"></h1>
<h4 ng-if="options.short_description" class="text-center text-2x m-b-lg sp-tagline-color" ng-bind="options.short_description"></h4>
<sp-widget widget="data.typeAheadSearch" />
</div>
</div>
Your Server Script should look like this:
data.typeAheadSearch = $sp.getWidget('typeahead-search', options.typeahead_search);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2018 08:28 AM
That's great, I really like this Daniel. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2021 09:13 AM
How would you change the color of the font to white?
Your HTML Template should look like this:
<div id="homepage-search" class="hidden-xs wrapper-xl">
<div class="wrapper-xl">
<h1 class="text-center text-3x m-b-lg sp-tagline-color" ng-bind="data.greeting"></h1>
<h4 ng-if="options.short_description" class="text-center text-2x m-b-lg sp-tagline-color" ng-bind="options.short_description"></h4>
<sp-widget widget="data.typeAheadSearch" />
</div>
</div>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2016 05:04 AM
For the newly cloned widget...
Just write the below line in the Server part:
data.user = gs.getUserName();