redirect.ftl throws a FreeMarker template error when target page cannot be found
--------------------------------------------------------------------------------

                 Key: MGNLSTK-753
                 URL: http://jira.magnolia-cms.com/browse/MGNLSTK-753
             Project: Magnolia Standard Templating Kit
          Issue Type: Bug
          Components: templates
    Affects Versions: 1.4.2
         Environment: Java 6, Mac OS X 10.6, Safari
            Reporter: Will Scheidegger
            Assignee: Philipp Bärfuss


When you rename a page which is the target of a redirect you will get a 
FreeMarker template error (at least in edit mode).

This template fixes the problem:

[#assign cms=JspTaglibs["cms-taglib"]]
[@cms.mainBar dialog="stkRedirect" /]
<p style="margin-top:40px">
[#if mgnl.editMode && content.path?has_content]
  [#assign targetContent = mgnl.getContent(content.path)!]
  [#if targetContent?has_content]
    [#assign path="${mgnl.createLink(targetContent)!''}"]
    This page will redirect to <a href="${path}">${path}</a>
  [#else]
    The target page (${content.path!}) could not be found. Please fix the 
redirect.
  [/#if]
[#else]
  Please define a path where to redirect the request.
[/#if]
</p>

Even better of course would be a redirect template that would store the UUID of 
the target page instead of the path!


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to