Adding Custom Fields onto a page

211 views
Skip to first unread message

ppie...@apps.cierant.com

unread,
Jul 18, 2018, 4:26:02 PM7/18/18
to XMPie Interest Group
Hey Everyone,

I'm no web designer, but I've gotten pretty familiar with the Coffee Skin. I can't figure out how to do something, though, so I was hoping someone out there can offer a suggestion. I think this should be easy, but I may be wrong.

I know that uStore has a set of parameters that it exposes on every page that can be used. These are the ones available, I think:

storeId : 2026,
cultureId : 1,
cultureCode : 'en-US',
                        currentUser : {
                            firstName : 'Patrick',
                            lastName : 'Pietras',
                            email : 'ppie...@apps.cierant.com',
                            phoneNumber : '',
                            mobileNumber : '',
                            faxNumber : '',
                            companyName : '',
                            department : '',
                            jobTitle : '',
                            externalId : '****',
                            gender : '',
                            birthday : '',
                            custom1 : '****',
                            custom2 : '',
                            custom3 : '',
                            custom4 : '',
                            custom5 : '',
                            userGroups : [{"ID":4,"Name":"Superuser Root"}]

I'm using the Coffee Skin, and I want to be able to show the user of the field Custom1 in their Navigation header. So, my question is this:

How do I address the field in my HTML code to call the custom1 field? I can't figure out the proper syntax to get it to work.

Any insight?

Thanks,
Patrick



couch

unread,
Jul 19, 2018, 3:37:55 AM7/19/18
to XMPie Interest Group
This simple javascript will add the text of "custom1" next to the logged in user name in the header area:

<script type="text/javascript">
  $(window).load(function(){
    $("#userWelcome span").append(xmp.sdk.storeFrontParams.currentUser.custom1);
  });
</script>

ppie...@apps.cierant.com

unread,
Jul 23, 2018, 12:36:43 PM7/23/18
to XMPie Interest Group
Thanks Couch. 

Is there no way to add an entirely new object? In an ideal world, I'd rather not append it to the welcome message if possible.

couch

unread,
Jul 23, 2018, 7:48:55 PM7/23/18
to XMPie Interest Group
Sure. You could use .after() or .insertAfter() to add a span or div or other object after an existing object instead of appending into an object.

ppie...@apps.cierant.com

unread,
Jul 24, 2018, 10:56:23 AM7/24/18
to XMPie Interest Group
Awesome. Thanks so much.

John Davidson

unread,
Oct 22, 2018, 10:14:35 AM10/22/18
to XMPie Interest Group
Steve:

I too do not know all the in's and out's of the syntax but feel that what I want to do should be possible. I would like to place the logged in users first name within my custom page HTML. Is this possible? I have a custom page loaded and I have tried using javascript to add it in, but I feel that I am not doing it well. Is this possible? 

Best, John

John Davidson

unread,
Oct 23, 2018, 12:07:23 PM10/23/18
to XMPie Interest Group
In thinking about this a bit more, it looks like I would need to pass the variable from the parent page to the iframe. I am still trying to follow the process for Javascript in getting this.

- John

couch

unread,
Oct 23, 2018, 10:18:20 PM10/23/18
to XMPie Interest Group
Is this a custom home page that you setup via store setup -> Appearance -> Use custom homepage? 
If yes, then you can pass querystring parameters to the iframe by using SQL in the box provided.
If no, then, we need to know what is the custom page, how it is being called/used, etc...

Igor

unread,
Oct 24, 2018, 12:34:16 PM10/24/18
to XMPie Interest Group
First I advised to view this powerpoint  around Coffee / pressocup skin .

Second I'd advise to look at existing templates this skin is using .
Read some basic Angular JS materials ...
if data exposed t the page you should be able to present it without much modification 
Reply all
Reply to author
Forward
0 new messages