- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2018 01:30 AM
Hello All,
I'm creating a widget for my homepage where I'd like to say the users first name in the middle of the screen. For example " <firstname>, welcome to the Hub ".
Widget Code:
HTML:
<div id="homepage-search" class="hidden-xs wrapper-md">
<div class="wrapper-md">
<h1 class="text-center font-thin text-4x m-b-lg sp-tagline-color" ng-bind="options.title"></h1>
<h4 ng-if="options.short_description" class="text-center m-b-lg sp-tagline-color" ng-bind="options.short_description"></h4>
</div>
</div>
CSS:
.sp-tagline-color {
color: $sp-tagline-color;
}
Cilent:
function() { /* widget controller */ var c = this;}
Any idea I'd go about doing this?
All help appreciated.
Thanks,
Jordan
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2018 06:24 PM
You should be able to get the user's first name from the scope, so write your client controller like this:
function($scope) {
var c = this;
c.welcome = $scope.user.first_name + " Welcome to the hub";
}
I am not sure where you wanted to put it in your html template, but you can reference it in there as {{c.welcome}}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2023 07:48 AM
but where we can write this script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2018 06:45 AM
Just messing around you can try this
Widget for the banner
body html template
<section id="banner" style="background-color: {{data.bannerColor}}; background-image: url({{data.banner}});">
<div class="container">
<div class="intro">
<h1 class="title">${Hi} {{user.first_name}}</h1>
<h4 class="message">{{options.welcome_message}}</h4>
</div>
</div>
</section>
Your banner and images to suit etc
then set up your welcome message etc
