Fórum
Regarding Active page links in navigation and bredcrums
Suneetha Ravipudi, modificado 11 Anos atrás.
Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
Hi ,
I have an issue related to links in navigation and bredcrums
Requirement is , when user clicks on one of the pages in navigation bar,
lets say home, department, services are the pages
and when user selects department page , that page should;nt show link in navigation and bredcrums
and when department page has child ( deptchild) and is selected , now parent should display with link.
Please provide solution to this.
Thank you,
Suneetha.
I have an issue related to links in navigation and bredcrums
Requirement is , when user clicks on one of the pages in navigation bar,
lets say home, department, services are the pages
and when user selects department page , that page should;nt show link in navigation and bredcrums
and when department page has child ( deptchild) and is selected , now parent should display with link.
Please provide solution to this.
Thank you,
Suneetha.
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
Hi Suneetha,
You mean you don't want to display current page in breadcrumb ?? Or current page name should be displayed without link ??
- TK
You mean you don't want to display current page in breadcrumb ?? Or current page name should be displayed without link ??
- TK
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
current page name should display with out link.
for ex:
when user is in home page
Liferay->home ( home should display with out link)
If it has child
Liferay->home->child ( child should display with out link and home should display with link)
for ex:
when user is in home page
Liferay->home ( home should display with out link)
If it has child
Liferay->home->child ( child should display with out link and home should display with link)
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
In that case you'll have to modify breadcrumb taglib init.jsp file via hook.
If you are not aware of how to override jsp using hook, Refere this.
Please find attached modified html\taglib\ui\breadcrumb\init.jsp. And below are the modification(bolded) in _buildLayoutBreadcrumb method.
Similar thread
Hope this will help you.
Thanks,
TK
If you are not aware of how to override jsp using hook, Refere this.
Please find attached modified html\taglib\ui\breadcrumb\init.jsp. And below are the modification(bolded) in _buildLayoutBreadcrumb method.
if (selLayout.isTypeControlPanel()) {
layoutURL = HttpUtil.removeParameter(layoutURL, "controlPanelCategory");
}
[b]breadcrumbSB.append("<li><span>");
if(selLayout == themeDisplay.getLayout())
{
breadcrumbSB.append(HtmlUtil.escape(selLayout.getName(themeDisplay.getLocale())));
} else
{
breadcrumbSB.append("<a href="\"");" breadcrumbsb.append(layouturl); breadcrumbsb.append("\" "); if (sellayout.istypecontrolpanel()) { breadcrumbsb.append(" target="\"_top\"");" } else breadcrumbsb.append(target);>");
breadcrumbSB.append(HtmlUtil.escape(selLayout.getName(themeDisplay.getLocale())));
breadcrumbSB.append("</a>");
}
breadcrumbSB.append("</span></li>");[/b]
Layout layoutParent = null;
Similar thread
Hope this will help you.
Thanks,
TK
Anexos:
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
Hi,
Thank you very much... its working
Thank you very much... its working
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
Great !!!
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
Hi tejas,
Its working well in breadcrumb, but i want the same in navigation bar.
Which jsp file I need to modify and please provide the logic code.
Thank you.
Its working well in breadcrumb, but i want the same in navigation bar.
Which jsp file I need to modify and please provide the logic code.
Thank you.
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
Logic would remain same.
Just check while looping through all the layouts for generating link, if layout == current layout then don't generate link.
For navigation you'll have to modify html\taglib\ui\navigation\page.jsp file.
Just check while looping through all the layouts for generating link, if layout == current layout then don't generate link.
For navigation you'll have to modify html\taglib\ui\navigation\page.jsp file.
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
i l try and let u knw
thank you.
thank you.
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
Hi,
I found some code regarding url generation in _buildNavigation method in page.jsp file.
sb.append("href=\"");
sb.append(HtmlUtil.escapeHREF(layoutURL));
sb.append("\" ");
sb.append(target);
sb.append("> ");
sb.append(HtmlUtil.escape(layoutChild.getName(themeDisplay.getLocale())));
sb.append("</a>");
Is this one which is generating link for current page?
And i modified as
}
if(rootLayout == themeDisplay.getLayout())
{
sb.append(HtmlUtil.escape(rootLayout.getName(themeDisplay.getLocale())));
}
else
{
sb.append("href=\"");
sb.append(HtmlUtil.escapeHREF(layoutURL));
sb.append("\" ");
sb.append(target);
sb.append("> ");
sb.append(HtmlUtil.escape(layoutChild.getName(themeDisplay.getLocale())));
sb.append("</a>");
}
but its not working, Please help in this
Thank you.
I found some code regarding url generation in _buildNavigation method in page.jsp file.
sb.append("href=\"");
sb.append(HtmlUtil.escapeHREF(layoutURL));
sb.append("\" ");
sb.append(target);
sb.append("> ");
sb.append(HtmlUtil.escape(layoutChild.getName(themeDisplay.getLocale())));
sb.append("</a>");
Is this one which is generating link for current page?
And i modified as
}
if(rootLayout == themeDisplay.getLayout())
{
sb.append(HtmlUtil.escape(rootLayout.getName(themeDisplay.getLocale())));
}
else
{
sb.append("href=\"");
sb.append(HtmlUtil.escapeHREF(layoutURL));
sb.append("\" ");
sb.append(target);
sb.append("> ");
sb.append(HtmlUtil.escape(layoutChild.getName(themeDisplay.getLocale())));
sb.append("</a>");
}
but its not working, Please help in this
Thank you.
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
Looks like you've missed some line for starting anchor tag (<a>).
As for current page we'll not have <a> at all.
HTH
As for current page we'll not have <a> at all.
HTH
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
I tried removing <a> elements in the above code but still same issue..
and also i tried in navigation.vm file. from theme.
there is no effect..
and also i tried in navigation.vm file. from theme.
there is no effect..
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
Before this let me clear your exact requirement,
You want to remove it from Navigation portlet or from theme menu navigation ???
You want to remove it from Navigation portlet or from theme menu navigation ???
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
can do from different ways.. but requirement is to disable the links of current page in navigation bar.
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
Check with attached navigation.vm file.
I've not tried it but it should work.
I've not tried it but it should work.
Anexos:
Suneetha Ravipudi, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Junior Member Postagens: 45 Data de Entrada: 17/10/11 Postagens Recentes
Hi Tejas,
Awesome its working thank you verry much....
Awesome its working thank you verry much....
Tejas Kanani, modificado 11 Anos atrás.
RE: Regarding Active page links in navigation and bredcrums
Liferay Master Postagens: 654 Data de Entrada: 06/01/09 Postagens Recentes
Great !!!