I want to change name appear in Liferay portal after logged in.
If i logged in Liferay, it has "Full name (Sign out)" on the top right of page.
Can I change the Full name to another name I config?
I have build a Liferay-login-portlet already.
You have to implement a hook for the file /html/portlet/dockbar/view.jsp replacing in this code...
<liferay-util:buffer var="userName">
<img alt="<liferay-ui:message key="manage-my-account" />" src="<%= HtmlUtil.escape(user.getPortraitURL(themeDisplay)) %>" />
<span class="user-full-name">
<%= HtmlUtil.escape(user.getFullName()) %>
</span>
</liferay-util:buffer>
where it says user.getFullName() with that you want. For example, to use the user nick, use this
<liferay-util:buffer var="userName">
<img alt="<liferay-ui:message key="manage-my-account" />" src="<%= HtmlUtil.escape(user.getPortraitURL(themeDisplay)) %>" />
<span class="user-full-name">
<%= HtmlUtil.escape(user.getScreenName()) %>
</span>
</liferay-util:buffer>
Hope this helps. Regards.
Related
I am trying to display image based on the path I get from database
here's my code
<% cars.forEach(function(car) { %>
<div class="card">
<div class="img">
<img src="images/" +"<%=car.Img_path %>">
</div>
</div>
<% }); %>
I also tried <img src="images/<%=car.Img_path %>"> but not working.
Can Anyone suggest how to render image.
Thanks In Advance.
<img src="images/<%=car.Img_path %>"> works. My issue was i didn't included Img_path in car model.
whoever may get this type of issue make sure you have included that field in model otherwise you will have data in database for but you wont get it in your application
I have express-flash installed and working, but only after I refresh the page I was redirected to. My controllers are using flash like so
req.flash("info", "No changes were made.");
res.redirect("/admin/dashboard");
In the view, I am importing a partial that looks like this.
<% if(messages.info) { %>
<div class="modal-content flashModal" id="message-info">
<div class="header">
<span id="closeBtn">×</span>
</div>
<div class="modal-body">
<strong>
<%= messages.info %>
</strong>
</div>
</div>
<% } %>
Not exactly sure what is causing the message to appear only after I have refreshed. It looks like the redirect is happening before the flash message? The documentation seemed straight forward enough but doesn't cover an issue like this. Any help is appreciated.
https://www.npmjs.com/package/express-flash
Try to use render instead of redirect. See if it works.
res.render('dashboard);
I could use some hints to get rid of the SAVED content in the coupon Plugin -
Screenshot of the area i want to remove
Thanks in advance!
O.
In the file widget/templates/List-Layout-1.html file you will see the following code:
<div class="col-xs-6 pull-left text-center primaryBackgroundTheme">
<a class="whiteTheme stretch" ng-
click="WidgetHome.showSavedItems()">Saved</a>
</div>
You can just update it to the following:
<div class="col-xs-6 pull-left text-center primaryBackgroundTheme">
</div>
The widget has 4 layouts, so depending on the layout that you want to use, you need to make sure to update the appropriate template.
I have a portlet page:
<%# taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<portlet:defineObjects />
<portlet:resourceURL var="resourceUrl">
<portlet:param name="startDate" value="" />
</portlet:resourceURL>
<input id="startdateexportaging" type="text" />
<a style="font-size: 15px;" href="${resourceUrl}" >URL</a>
How to pass the content of startdateexportaging as portlet param startDate when clicking the link with resourceUrl?
You could use an onclick handler to add the content to the URL as soon the link is clicked. But that would be cumbersome, error prone and not necessary.
Instead you should add your input to a form and define the URL as action parameter:
<aui:form action="<%= resourceUrl.toString() %>" method="get">
<aui:input name="startDate" type="text" />
<aui:button value="Download" type="submit" />
</aui:form>
(if you don't use AUI - you can use simple HTML tags as well)
Another advantage of this solution: A button instead of a link makes it easier for the user to understand that the content from the text field is submitted. Compare it with the use of links and buttons here on SO - if you enter some information you have to hit a button.
And it is easier for search engines to parse the website, as those try to follow links - but ignore buttons.
I have a requirement that I have to display sign in url in webcontent, if user not logged in and also need to display if user logged I have to display sign out hyper link. I have searched somewhere got $is_signed_in is for checking user logged in or not. After that I have added the below code to my requirement. Even though user is logged or not it is displaying "To know more please Sign In". Why condition failed? and how to check user logged in or not in liferay velocity? I have observed that I am not getting the values of $is_signed_in,$sign_in_url,$sign_out_url
#if(!$is_signed_in)
To know more please Sign In
#else
click here to Sign Out
#end
$is_signed_in is available in themes, not in webcontent templates.
Try
#set ($themeDisplay = $httpServletRequest.getAttribute("THEME_DISPLAY"))
$themeDisplay.isSignedIn()
this should work in webcontent templates.
(Thanks #Gonzalo for the reminder to initialize $themeDisplay prior to use)
in your theme _diff/templates/portal_normal.vm, you have add this code.
if ($is_signed_in)
<!-- user dropdown starts -->
<div class="btn-group pull-right" >
<a class="btn dropdown-toggle" data-toggle="dropdown" href="#">
<i class="icon-user"></i><span class="hidden-phone"> $user_name </span>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>Logout</li>
</ul>
</div>
<!-- user dropdown ends -->
#end
Check the below link -
https://www.liferay.com/community/forums/-/message_boards/message/25175535
Try adding this code in portal-ext.properties
journal.template.velocity.restricted.variables=