Created
July 11, 2012 23:56
-
-
Save farmerbradllc/3094554 to your computer and use it in GitHub Desktop.
Grab Organization Logo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Get Services | |
| #set ($organizationLocalService = $serviceLocator.findService('com.liferay.portal.service.OrganizationLocalService')) | |
| #set ($imageLocalService = $serviceLocator.findService('com.liferay.portal.service.ImageLocalService')) | |
| #set($organizations = $user.getOrganizations()) | |
| #set ($defaultOrganization = $organizationLocalService.getOrganizations(0,1)) | |
| #if($organizations.size() > 0) | |
| #set($organizations = $organizations.get(0)) | |
| #else | |
| #foreach ($defaultOrganization in $defaultOrganization) | |
| #set($organizations = $defaultOrganization) | |
| #end | |
| #end | |
| #set ($image = $imageLocalService.getImage($organizations.getLogoId())) | |
| #set($site_logo_height = $image.height) | |
| #set($site_logo_width = $image.width) | |
| #set($site_logo = "/image/organization_logo?img_id=" + $organizations.getLogoId()) |
Author
farmerbradllc
commented
Jul 12, 2012
via email
because this is a particular use case for a client
Bradley Wood
Software Engineer
[email protected]
…---
23 May 2012 |\* Liferay *_France Symposium_ |
liferay.com/france2012http://www.liferay.com/france2012
8-9 October 2012 |\* Liferay *_North America Symposium_ |
liferay.com/northamerica2012 http://www.liferay.com/northamerica2012
16-17 October 2012 |\* Liferay *_Europe Symposium_ |
liferay.com/europe2012http://www.liferay.com/europe2012
24-25 October 2012 |\* Liferay *_Spain Symposium_ |
liferay.com/spain2012http://www.liferay.com/spain2012
Visit Us: www.liferay.com | Like Us: facebook.com/liferay | Follow Us:
twitter.com/liferay
On Wed, Jul 11, 2012 at 5:41 PM, Aaron Delani < ***@***.*** > wrote:
Why are you replacing the $site_logo? What if the client wants to use the
$site_logo semantically for an actual site logo rather than an
organization's logo?
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/3094554
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment