Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Asset Publisher View url
Hi, i am using liferay 7.2 GA 1
i have a custom asset called post entry i have mapped view url in the template.
when a user click the title of the asset it is displaying the summary from asset renderer in the same page on the same block.
what i want is when a user click on the title it should redirect in to a new page and display the summary in the allocated block. is it possible ?
i have a custom asset called post entry i have mapped view url in the template.
when a user click the title of the asset it is displaying the summary from asset renderer in the same page on the same block.
what i want is when a user click on the title it should redirect in to a new page and display the summary in the allocated block. is it possible ?
Hi,Can Anyone Help me on this please...
To display assets in a separate page use the setting "show in context" for the "asset link behavior" configuration of the asset publisher.More information about the configuration options can be found in the documentation: https://portal.liferay.dev/docs/7-2/user/-/knowledge_base/u/configuring-display-settings
No even though the view in context is set it is not working.because the asset is created in the admin panel and given access to the guest user to view it so unfortunely view in context and view fullcontent both resulting in displaying fullcontent. is there any other way available like web content to mark the display page for the specific asset ? for custom asset or for category.
You can try setting path where to display in AssetRenderer of your custom asset
public String getURLViewInContext(LiferayPortletRequest liferayPortletRequest,LiferayPortletResponse liferayPortletResponse,String noSuchEntryRedirect) {
return url where u want to show;
}
Mohammed Yasin:
You can try setting path where to display in AssetRenderer of your custom assetpublic String getURLViewInContext(LiferayPortletRequest liferayPortletRequest,LiferayPortletResponse liferayPortletResponse,String noSuchEntryRedirect) {
return url where u want to show; }
Yea i have tried that too
my method :
@Override
protected String getURLViewInContext(LiferayPortletRequest liferayPortletRequest, String noSuchEntryRedirect,
String path, String primaryKeyParameterName, long primaryKeyParameterValue) {
// TODO Auto-generated method stub
System.out.println("Hello world");
return super.getURLViewInContext(liferayPortletRequest, noSuchEntryRedirect, path, primaryKeyParameterName,
primaryKeyParameterValue);
}
but its no luck when the asset behaviour is set to view in context the above method didnt get called i dont know why.
i tried the same in getURLView also but it was no luck.
Arun Pandian:
I've seen System.out output being swallowed when running from within eclipse. Try logging instead or set a breakpoint to make extra extra sure that this method is indeed not called - that one fooled me once and took quite some time to resolve, until I figured out that it just doesn't end up in eclipse's console.
Yea i have tried that too
... System.out.println("Hello world"); ...
Thanks for the suggestion after some workaround i found that there are 2 method of the same name
have to use,
public String getURLViewInContext(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, String noSuchEntryRedirect) throws Exception {
instead of
protected String getURLViewInContext(LiferayPortletRequest liferayPortletRequest, String noSuchEntryRedirect,
String path, String primaryKeyParameterName, long primaryKeyParameterValue) {
have to use,
public String getURLViewInContext(LiferayPortletRequest liferayPortletRequest,
LiferayPortletResponse liferayPortletResponse, String noSuchEntryRedirect) throws Exception {
instead of
protected String getURLViewInContext(LiferayPortletRequest liferayPortletRequest, String noSuchEntryRedirect,
String path, String primaryKeyParameterName, long primaryKeyParameterValue) {
Instead of giving static url can it be done dynamically ? like web contents set a display page such scenerio can be done in liferay 7.2 GA 1
and how to get a static url of a portlet to set in the getviewurlincontext can anyone give me an example please.
and how to get a static url of a portlet to set in the getviewurlincontext can anyone give me an example please.
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™