..and the lightbulb goes on! Thanks!

-Karla

From: Demian Katz [mailto:demian.katz@villanova.edu]
Sent: Friday, October 12, 2012 10:17 AM
To: Karla Smith; vufind-tech@lists.sourceforge.net
Subject: RE: Username display on more than profile page?

 

You use -> when referencing an object and . when referencing an array...

So if in PHP you would have to use $object->property, you also use $object->property in Smarty.

If in PHP you would have to use $array['key'], you use $array.key in Smarty.

- Demian


From: Karla Smith [smith@winnefox.org]
Sent: Friday, October 12, 2012 11:13 AM
To: vufind-tech@lists.sourceforge.net
Subject: Re: [VuFind-Tech] Username display on more than profile page?

Thanks Demian,

I tried {$user.firstname} based on the {$profile.firstname} example.  How does one know when to use “->” and when to use “.”? 

 

I have been looking at Smarty and PHP tutorials, and there are lots of examples of both “.” and “->”, but I can’t find any explanations.

--Karla

 

From: Demian Katz [mailto:demian.katz@villanova.edu]
Sent: Friday, October 12, 2012 7:35 AM
To: Karla Smith; vufind-tech@lists.sourceforge.net
Subject: RE: Username display on more than profile page?

 

When a user is logged in, the object representing their account is available to all templates as $user.  That's probably the easiest way to customize the display.  You could try something like:

{if $user}{$user->firstname|escape} {$user->lastname|escape}{/if}

(the "if $user" probably isn't necessary, but I'm just being extra careful).

- Demian


From: Karla Smith [smith@winnefox.org]
Sent: Thursday, October 11, 2012 6:17 PM
To: vufind-tech@lists.sourceforge.net
Subject: [VuFind-Tech] Username display on more than profile page?

Hi,

I would like to display the patron name at the top of their list of checkouts (and maybe on other MyResearch pages).  So far, no luck.

I thought maybe since {$profile.firstname|trim|escape} displayed it on profile.tpl, I could use that.   Nope.

I thought that maybe there’d be something in Profile.php that I could copy and use in CheckoutOut.php to assign the variable there, but I didn’t see anything that looked promising.

 

Any suggestions?

 

Thanks,

--Karla

Karla Smith, ILS Manager

Winnefox Library System

Oshkosh, WI 54904

~If Truth is Beauty, how come no one has their hair done in the library? – Lily Tomlin

 


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.