掲示板
Passing variable or parameters from a portlet to the portal_normal.vm
14年前 に domingo l hilario によって更新されました。
Passing variable or parameters from a portlet to the portal_normal.vm
Junior Member 投稿: 46 参加年月日: 09/02/05 最新の投稿
Good Morning Guys,
I have a little issue. I've been trying to set a variable that if it show no content then the portal_normal.vm will close the breaking news banner.
what I am trying to do is
I need some help. Is that durable? can that be done.
I have a little issue. I've been trying to set a variable that if it show no content then the portal_normal.vm will close the breaking news banner.
what I am trying to do is
set paramenter or string on cn2-breaking news portlet. The value content.length > 0 the variable or parameter will be set and pass to the portal_normal.vm
#set( $active = request.get("parameter").get("active") )
#if (!$active)
<div class="breaking news"> flash scrolling text </div>
#end
<b>$active</b>
I need some help. Is that durable? can that be done.
14年前 に Lisa Simpson によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Liferay Legend 投稿: 2034 参加年月日: 09/03/05 最新の投稿
*BUMP*
14年前 に domingo l hilario によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Junior Member 投稿: 46 参加年月日: 09/02/05 最新の投稿
*BUMP*, come on Lisa you can do better than that. ;)
Can this be done.
Can this be done.
14年前 に Lisa Simpson によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Liferay Legend 投稿: 2034 参加年月日: 09/03/05 最新の投稿
If I knew, I would tell you. Quite frankly, I have no idea. Hence the *BUMP*
14年前 に domingo l hilario によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Junior Member 投稿: 46 参加年月日: 09/02/05 最新の投稿
I know, I was just kidding with you...
14年前 に Bruno Farache によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Liferay Master 投稿: 603 参加年月日: 07/05/14 最新の投稿
Domingo Hilarious, "parameter" should be in the plural, like:
$request.parameters.active
or
$request.get("parameters").get("active")
*BUMP*
$request.parameters.active
or
$request.get("parameters").get("active")
*BUMP*
14年前 に domingo l hilario によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Junior Member 投稿: 46 参加年月日: 09/02/05 最新の投稿
sorry I miss spelled it
will this work, and how do I called it from the portlet
will this work, and how do I called it from the portlet
import java.io.StringWriter;
import java.io.Writer;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.tools.generic.RenderTool;
public class VMDemo {
public static void main(String[] args) throws Exception {
Velocity.init();
Template t = Velocity.getTemplate("./src/VMDemo.vm");
VelocityContext ctx = new VelocityContext();
ctx.put("myName","Joe");
Writer writer = new StringWriter();
t.merge(ctx, writer);
System.out.println(writer);
}
}
14年前 に Bruno Farache によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Liferay Master 投稿: 603 参加年月日: 07/05/14 最新の投稿
Sorry I didn't get it, you typed render.parameters incorrectly in your script and now is working or you typed it incorrectly in this forum thread?
Use com.liferay.portal.kernel.velocity.VelocityEngineUtil to process vm scripts from portlets.
Use com.liferay.portal.kernel.velocity.VelocityEngineUtil to process vm scripts from portlets.
14年前 に domingo l hilario によって更新されました。
RE: Passing variable or parameters from a portlet to the template .vm
Junior Member 投稿: 46 参加年月日: 09/02/05 最新の投稿
I am trying whatever I can do to pass either a variable, paramter, or proterty to the portal_normal.vm
I have look at the package you metioned, and I thouth the package is located under the portal-kernel.jar file but is not there. where can I find the jar file with the velocity.
I have look at the package you metioned, and I thouth the package is located under the portal-kernel.jar file but is not there. where can I find the jar file with the velocity.