掲示板
how can i change portlet title in velocity template?
11年前 に maryam maryam masoudy によって更新されました。
how can i change portlet title in velocity template?
Regular Member 投稿: 149 参加年月日: 11/10/30 最新の投稿
hi
i want to set portlet title in velocity template
i work with liferay6.1
i wrote this code but portlet title didnot change
in portlet option >advance, styling portlet id is : Portlet ID: #portlet_56_INSTANCE_Xmi4S46xzzfL
i use 56_INSTANCE_Xmi4S46xzzfL it is corect?
is my velocity corect?
how can i change portlet title in velocity template?
thanks
i want to set portlet title in velocity template
i work with liferay6.1
i wrote this code but portlet title didnot change
#set ($myPortletId = "56_INSTANCE_Xmi4S46xzzfL")
$velocityPortletPreferences.setValue("custom-title", "bbbbbbbbb")
$velocityPortletPreferences.setValue("title", "kkkkkkkk")
$velocityPortletPreferences.setValue("portlet-title", "cccccccc")
$theme.runtime($myPortletId, '', $velocityPortletPreferences.toString())
#set ($VOID = $velocityPortletPreferences.reset())
in portlet option >advance, styling portlet id is : Portlet ID: #portlet_56_INSTANCE_Xmi4S46xzzfL
i use 56_INSTANCE_Xmi4S46xzzfL it is corect?
is my velocity corect?
how can i change portlet title in velocity template?
thanks
11年前 に Pavel Savinov によって更新されました。
RE: how can i change portlet title in velocity template?
Junior Member 投稿: 94 参加年月日: 12/09/24 最新の投稿
Hi Maryam.
Try $portletDisplay.setTitle("yourTitleHere");
Try $portletDisplay.setTitle("yourTitleHere");
11年前 に maryam maryam masoudy によって更新されました。
RE: how can i change portlet title in velocity template?
Regular Member 投稿: 149 参加年月日: 11/10/30 最新の投稿
i wrote $portletDisplay.setTitle("yourTitleHere") but in content
shown $portletDisplay.setTitle("yourTitleHere") without any result and my title didnot change
do i write $portletDisplay.setTitle("yourTitleHere") only without anything?
thanks
shown $portletDisplay.setTitle("yourTitleHere") without any result and my title didnot change
do i write $portletDisplay.setTitle("yourTitleHere") only without anything?
thanks
11年前 に Pavel Savinov によって更新されました。
RE: how can i change portlet title in velocity template?
Junior Member 投稿: 94 参加年月日: 12/09/24 最新の投稿
I've checked it. Unfortunatelly $portletDisplay object is not available in the CMS content templates
I'll try to find out some other method.
I'll try to find out some other method.
11年前 に maryam maryam masoudy によって更新されました。
RE: how can i change portlet title in velocity template?
Regular Member 投稿: 149 参加年月日: 11/10/30 最新の投稿
ohhh thanks Pavel
but i donot knew what do i do
but i donot knew what do i do
11年前 に Nikhil Nishchal によって更新されました。
RE: how can i change portlet title in velocity template?
Regular Member 投稿: 177 参加年月日: 12/06/22 最新の投稿Pavel Savinov:
I've checked it. Unfortunatelly $portletDisplay object is not available in the CMS content templates
I'll try to find out some other method.
$portletDisplay object can be get through
$request.get("theme-display").get("portlet-display")
Or
$request.theme-display.portlet-display
11年前 に maryam maryam masoudy によって更新されました。
RE: how can i change portlet title in velocity template?
Regular Member 投稿: 149 参加年月日: 11/10/30 最新の投稿
Hi Nikhil Nishchal thanks for reply
i could get portlet title but now how do i set my title?
i could get portlet title but now how do i set my title?
11年前 に Pavel Savinov によって更新されました。
RE: how can i change portlet title in velocity template? (回答)
Junior Member 投稿: 94 参加年月日: 12/09/24 最新の投稿
Maryam, Liferay hack for you
Put following code into your template text, replace newTitle var value with desired title.
It works fine on 6.1.1 CE
Put following code into your template text, replace newTitle var value with desired title.
<script>
function updatePortletTitle(children,title) {
if (children!=null && children.length>0) {
for (var k=0;k<children.length;k++) {
if (children[k].className == 'portlet-title-text') {
children[k].innerHTML = title;
break;
}
if (children[k].childNodes != null &&
children[k].childNodes.length > 0) {
updatePortletTitle(children[k].childNodes,title);
}
}
}
}
var portletId = "portlet_$request.theme-display.portlet-display.id";
var portletSection = document.getElementById(portletId);
var newTitle = "Test Dynamic Title";
updatePortletTitle(portletSection.childNodes,newTitle);
</script>
It works fine on 6.1.1 CE
11年前 に maryam maryam masoudy によって更新されました。
RE: how can i change portlet title in velocity template?
Regular Member 投稿: 149 参加年月日: 11/10/30 最新の投稿
thanks Pavel
i write this code in velocity template?
i write this code in velocity template?
11年前 に Pavel Savinov によって更新されました。
RE: how can i change portlet title in velocity template?
Junior Member 投稿: 94 参加年月日: 12/09/24 最新の投稿maryam maryam masoudy:
thanks Pavel
i write this code in velocity template?
Yes, in the template text.
11年前 に maryam maryam masoudy によって更新されました。
RE: how can i change portlet title in velocity template?
Regular Member 投稿: 149 参加年月日: 11/10/30 最新の投稿
ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Pavel it is correct thanks veryyyyyyyyyyyyyyyyyyyyyyyy much
Pavel it is correct thanks veryyyyyyyyyyyyyyyyyyyyyyyy much
11年前 に Alireza Zare によって更新されました。
RE: how can i change portlet title in velocity template? (回答)
Regular Member 投稿: 110 参加年月日: 10/09/03 最新の投稿
The short version:
<script>
AUI().ready(function(A) {
var portletContainer= A.one("#portlet_$request.theme-display.portlet-display.id");
var portletTitle= portletContainer.one(".portlet-title-text");
portletTitle.setContent("News");
});
</script>
<script>
AUI().ready(function(A) {
var portletContainer= A.one("#portlet_$request.theme-display.portlet-display.id");
var portletTitle= portletContainer.one(".portlet-title-text");
portletTitle.setContent("News");
});
</script>
11年前 に maryam maryam masoudy によって更新されました。
RE: how can i change portlet title in velocity template?
Regular Member 投稿: 149 参加年月日: 11/10/30 最新の投稿
thanks for reply
9年前 に Muhammad Ghufron によって更新されました。
RE: how can i change portlet title in velocity template?
New Member 投稿: 18 参加年月日: 14/08/08 最新の投稿Alireza Zare:
The short version:
<script>
AUI().ready(function(A) {
var portletContainer= A.one("#portlet_$request.theme-display.portlet-display.id");
var portletTitle= portletContainer.one(".portlet-title-text");
portletTitle.setContent("News");
});
</script>
thank you very much Alireza Zare,