I want to make some changes on template(portlet.vm) in liferay based on some condition. And condition is to know whether user is signed in or not. Something like:
#if ($is_signed_in)
<section class="portlet" id="portlet_$portlet_id">
..
...
</section>
#else
//Some other divs
#end
I m trying to access $is_signed_in variable, but its not wokring. Kindly tell me solution of this problem. Thanks in advance.
Yeah got my answer. To use $is_signed_in variable in portlet.vm, we need to include
#parse ($init)
Related
Is there a way to set Modx Revolution to output HTML <br>s using the :nlb2r output filter rather than XHTML <br />s through a system setting?
Just create custom snippet - http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29 , as example:
<?php
$mode = !empty($options) ? true : false;
return nl2br($input, $mode);
This filter does not depend on the system settings, he is located in the code modx- https://github.com/modxcms/revolution/blob/develop/core/model/modx/filters/modoutputfilter.class.php#L431 so you need to create custom snippet.
Output filters are hard coded.
You could always:
SomeElement:nl2br:replace=`<br />==<br>`
Not really sure you want to drop the / as HTML5 simply ignores it. But any case, replace will serve you well.
Check out chapter 7 of my book, it has all of the filters and examples on how to chain them.
You should avoid using snippets and filters are much as you can. They increase the parsing-time.
There's a setting for what you ask
Search for tiny.element_format and change it to html.
I'm trying to create a menu template in JSF where the link for the current directory has a different "current" or "active" class. The code currently looks like:
<ul>
<li><h:outputLink value="#{request.contextPath}/a/">A</h:outputLink></li>
<li><h:outputLink value="#{request.contextPath}/b/">B</h:outputLink></li>
<li><h:outputLink value="#{request.contextPath}/c/">C</h:outputLink></li>
</ul>
I'm thinking of using something like styleClass="#{(thisDir == currentDir) ? currentLinkClass : normalLinkClass}". But how do I get the current path? Is this even correct, or is there a better way to do this?
Also, I want the links to base on the current path, not just the page. For example, myapp/a/1.jsf and myapp/a/2.jsf (that is, myapp/a/*.jsf) should trigger the active class for the A link. (I hope my explanation is clear.) Is this possible? How should this be done?
Thank you very much!
You can use #{request.requestURI} to get the current request URI. You can if necessary use several EL functions from JSTL fn taglib to do some string comparisons/manipulations in EL.
Your proposed EL styleClass suggestion is perfectly fine. There is no other easy way anyway. Best optimization which you could do so far is to render those links in a loop by an <ui:repeat> so that code duplication is at least eliminated.
You can also try this approach which uses #{view.viewId}:
<h:outputLink
styleClass="#{(view.viewId.equals('/admin/authors.xhtml')) ? 'active' : 'inactive'}"
value="authors.xhtml">Text</h:outputLink>
I am working on a site in which there is two type of user- 'Company' and 'Consultant'. I am using content profile and auto assign role for this. in the registration of consultant i have a field to select main area and sub area (for ex-Science and Technology[as Main Area] and Biology and medicine[as Sub Area]). I want to use Hierarchical select but I am doing something wrong so it is not working.
So please either tell me the steps of Hierarchical Select or suggest me another module for this.
Please help.
Try adding this in your tpl whether you are using one.
<div style="display:none">
<?php print drupal_render($form) ?>
</div>
I use the same modules and it works.
I'm working on this for days now and I just can't figure it out..
My question is: Is it possible to alter the login.html file in the view.secure folder, so that I could include it in another html-file with #{include 'views/login.html'}, let's say in the index.html, as a login-sidebox, and how could this work?
Move the code to a tag. Simply move the file "login.html" under tags folder, and then you can use it as:
#{login /}
That said, be careful. I don't have the code here but it may be that login is using some vars. If that's the case, you'll need to pas the vars to the tag and modify the tag slightly. For example, assume you have a var called "name" in the tag. You'll have to change "name" to "_name" in the tag and pass the var as parameter in the tag, as follows:
#{login name:name /}
This is the standard behavior of tags. You can check existing tags in the "samples" folder of the framework for more help.
Probably with #{extends 'index.html' /} combined with #{doLayout /} as shown in documentation.
With all of your friendly assistance i solved the problem!
I included the login-form into all sites i want it in, and when I get logged in or logged out, I use the onAuthenticated()/onDisconnected() to redirect to the wanted site!
But there is one problem left! If the case appears that a error message is displayed, like "User not existing" or something, it is not possible to handle that case.. it would be nice if you could also help me with that.
I've written a completely new page that uses Sharepoint's ListFieldIterator. I would like to exclude few fields from the view and I've found a solution using ExcludeFields but it simply doesn't work. The control always displays all fields, nevermind what's in ExcludeFields property. I couldn't find anyone complaining about such a problem on the internet.
There's the code (nothing fancy):
<Sharepoint:ListFieldIterator ID="lfiItemDetails" ControlMode="Display" runat="server" ExcludeFields="TestId" />
ListId and ItemId are set programmatically in OnInit.
Try it with a hash. So for the column I want to hide called "PrintOrder" I changed it from:
<SharePoint:ListFieldIterator ControlMode="Display" TemplateName="WideFieldListIterator" ExcludeFields="FileLeafRef;#WikiField" runat="server"/>
to
<SharePoint:ListFieldIterator ControlMode="Display" TemplateName="WideFieldListIterator" ExcludeFields="FileLeafRef;#WikiField;#PrintOrder" runat="server"/>
That worked for me.
Incase anyone else hits this. ExcludeFields dow not work if ControlMode is Display(at least on my version of. You need to either hide the field with Javascript or set ShowInDisplayform=False