We usually use the following simple user macro:
## @param PageId:title=Page Id|type=int|required=true|desc=The ID of the page #set ( $Integer = 0 ) #set ( $pageId = $Integer.parseInt($paramPageId) ) #set ( $page = $pageManager.getPage($pageId) ) Is favourite? $page.isFavourite($action.remoteUser)
Hope this helps
You can do this via database:
select * from content_label where labelid IN (select labelid from label where namespace = 'my' AND name = 'favourite') AND contentid = INSERT-PAGE-ID-HERE;
Remember to change the INSERT
-PAGE-ID-HERE
accordingly.
If there is no row returned, page is not favourited.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Or you write a little usermacro which you can use on every page
## @param pageId:title=pageId|type=int|required=true|desc=Insert the pageId #set($Integer = 0) #set($parampageId = $Integer.parseInt($parampageId)) #set($pageById = $pageManager.getAbstractPage($parampageId)) #if($pageById) #foreach( $label in $pageById.labels) #if($label == "my:favourite") #set($isFavourite = true) #break #end #end This page is #if(!$isFavourite) not #end a favourite page. #else No page found! #end
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
both good answers ;-)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.