Hello,
I would like to insert the link "Add page" in a different place than the menu. The link will be displayed if you have editing rights, otherwise the link will not be displayed. For the links "Edit", "export", "side information" and "space admin", it already works. Either the link is displayed regardless of the permissions all the time or not.
#set ($spaceKey = $helper.spaceKey) #if ($permissionHelper.canCreatePage($remoteUser, $space)) ## if user currently viewing a page, add page automatically creates a new page with that page is the parent #if ($helper.page.pageId && !$helper.page.postingDay) <a href="$req.contextPath/pages/createpage.action?spaceKey=$generalUtil.urlEncode($spaceKey)&fromPageId=$helper.page.id">$action.getText('add.page')</a> #else <a href="$req.contextPath/pages/createpage.action?spaceKey=$generalUtil.urlEncode($spaceKey)">$action.getText('add.page')</a> #end #end
Where is my mistake in the code? In this case the link does not appear.
Thank you!
The challenge is solved! I've done it and it works.
what was the problem?
In case anyone comes across this same problem in the future, then they will also know (or have some ideas) as to how to resolve it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is obviously a good idea. I was looking for a way to make a link "add page" insert into my theme. The link should be displayed in dependence on the user rights. I've now solved it like this:
#set ($pageId = $sitemeshPage.getProperty("page.pageId")) #if ($sitemeshPage && $req && $pageId != 0 && $permissionCheckDispatcher.isPermitted("/pages/createpage.action?spaceKey=$generalUtil.urlEncode($spaceKey)&fromPageId=$pageId")) <a class="newpage" href="$req.contextPath/pages/createpage.action?spaceKey=$generalUtil.urlEncode($spaceKey)&fromPageId=$pageId" title="$action.getText("de.vw.wiki.theme.kgkui.action.newpage")">$action.getText("de.vw.wiki.theme.kgkui.action.newpage")</a> #end
Exactly what I wanted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is obviously a good idea. I was looking for a way to make a link "add page" insert into my theme. The link should be displayed in dependence on the user rights. I've now solved it like this:
#set ($pageId = $sitemeshPage.getProperty("page.pageId")) #if ($sitemeshPage && $req && $pageId != 0 && $permissionCheckDispatcher.isPermitted("/pages/createpage.action?spaceKey=$generalUtil.urlEncode($spaceKey)&fromPageId=$pageId")) <a class="newpage" href="$req.contextPath/pages/createpage.action?spaceKey=$generalUtil.urlEncode($spaceKey)&fromPageId=$pageId" title="$action.getText("xx.xx.xxxx.xxxxx.xxxxx.action.newpage")">$action.getText("xx.xx.xxxx.xxxxx.xxxxx.action.newpage")</a> #end
Exactly what I wanted.
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.