Fórumok
Get AssetEntry view URL
Maximiliano Chiesa, módosítva 11 év-val korábban
Get AssetEntry view URL
Junior Member Bejegyzések: 47 Csatlakozás dátuma: 2012.07.20. Legújabb bejegyzések
Hi!
I have a portlet in which I order assets according to their categories. For each AssetEntry I want to generate a link to it's "view". The problem is that I don't know how to get that URL programatically and set it to the link's href property.
Is there a way of making this?
Thanks in advance!
I have a portlet in which I order assets according to their categories. For each AssetEntry I want to generate a link to it's "view". The problem is that I don't know how to get that URL programatically and set it to the link's href property.
Is there a way of making this?
Thanks in advance!
Dave Weitzel, módosítva 11 év-val korábban
RE: Get AssetEntry view URL
Regular Member Bejegyzések: 208 Csatlakozás dátuma: 2009.11.18. Legújabb bejegyzések
I suggest you look at how AssetPublisher does it.
Basically it has to identify a page layout (plid) that contains the right portlet for the asset type you are displaying , then standard portlet options will allow you to maximize the portlet to show larger view of the asset.
Basically it has to identify a page layout (plid) that contains the right portlet for the asset type you are displaying , then standard portlet options will allow you to maximize the portlet to show larger view of the asset.
Gregor Bregenzer, módosítva 11 év-val korábban
RE: Get AssetEntry view URL
New Member Bejegyzés: 1 Csatlakozás dátuma: 2012.10.22. Legújabb bejegyzések
Hi!
In case you want to see the URL in each Asset Entry you can make a Hook for that. Just overwrite /WEB-INF/jsps/html/portlet/asset_publisher/display/full_content.jsp
and add the following content after line 217:
Now every AssetEntry has a Button in the bottom, which shows the friendly url.
In case you want to see the URL in each Asset Entry you can make a Hook for that. Just overwrite /WEB-INF/jsps/html/portlet/asset_publisher/display/full_content.jsp
and add the following content after line 217:
<div class="urlBox">
<hr>
<input id="entryButton" type="button" name="entryURL" value="Entry URL" onClick="toggle(this)">
<div id="entryURL">
<%
String currentGroup = themeDisplay.getLayout().getGroup().getFriendlyURL();
String friendlyURL = themeDisplay.getPortalURL() + currentGroup + "/-/" + assetRenderer.getUrlTitle();
%>
<a href="<%= friendlyURL %>"> <%= friendlyURL %> </a>
</div>
</div>
<script>
var entryURL = document.getElementById('entryURL');
var isShown = true;
entryURL.style.display = 'none';
function toggle(entryButton) {
if (isShown)
{
entryURL.style.display = 'block';
isShown = false;
entryButton.value= 'Hide';
}
else
{
entryURL.style.display = 'none';
isShown = true;
entryButton.value= 'Entry URL';
}
}
</script>
Now every AssetEntry has a Button in the bottom, which shows the friendly url.