Redirection in Confluence 4

Jussi Savolainen October 11, 2011

Hi,

What would be the preferred way to implement a redirect from a page to an external source in Confluence 4? I'm not finding the "redirect" macro, perhaps it's not part the new version anymore? Confluence newbie here so bare with me... thanks!

Jussi

EDIT:

4 answers

4 votes
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
October 11, 2011

It should be pretty easy to do this as a user macro using JavaScript -- if that's deemed acceptable.

Something like this...

## Macro title: Redirect
## Macro has a body: N
## Body processing: No macro body
## Output: Selected output option
##
## Developed by: David Simpson
## Date created: 2011-10-12
## Installed by: My Name

## This is an example macro
## @param url:title=URL|type=string|required=true|desc=The external webpage to redirect to


Redirecting to: <a id="redirectMe" href="$paramurl">$paramurl</a>

<script>
  AJS.toInit(function(){
    window.location.replace( AJS.$('#redirectMe').attr('href') );
  });
</script>

You'll have fun trying to edit the page after doing this though, so maybe add a setTimeout option :)

Jussi Savolainen October 11, 2011

Thanks! Yes I thought I have to go with the JS option for now on (until a proper plugin appears... and perhaps with an option that admins won't get redirected to the new place to avoid the problem you mentioned:)

1 vote
David Peterson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 8, 2011

Hey there, we will be updating Redirect to work 'natively' with 4.0, but no timeline currently. Hopefully not too long, but keep an eye on community.customware.net for updates.

1 vote
Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 11, 2011
Redirect macro probably works, but plugin needs to be installed manually (download/upload) until the plugin exchange shows a compatible version.
Jussi Savolainen October 11, 2011

Tried with this one:

https://plugins.atlassian.com/plugin/details/183

Installs ok but won't recognize macro.

EDIT:

And with this one:

https://plugins.atlassian.com/plugin/details/22940

Again, installs ok (at least no visible errors on the admin interface), but the forward rules not working. Perhaps wiser to wait for the official version for C4...

Matt
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2011

Try inserting the markup for the macro using the Wiki Markup Dialog via the Insert menu. It may still work despite not yet being updated to support 4.0 – i9.e. not recogized by the Macro Browser and Macro Autocomplete.

Jussi Savolainen October 11, 2011

Thanks! This works indeed (with this plugin https://plugins.atlassian.com/plugin/details/183)

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2011

Matt, there is some confusion about the difference between migration mode and fully compatible mode for plugins. It would be helpful if there was some documentation that described for end users how to deal with that. It was really nice for migration that Confluence supported migrated macros but there are lots of gotchas for end users - like your comment above. Specifically, many plugins will work whether or not they have been marked as compatible in the plugin exchange. Marking them compatible, means they can be installed via UPM and used, but may not be upgraded to fully support usage outside of via wiki markup. So instead of 2 choices - it works/doesn't work, there are 3 - it works in migration mode, it works in 4.0 mode, or it doesn't work at all. Unfortunately, there is no easy way to tell the difference. I have tried to head off user difficulties for some of my plugins via Confluence 4.0 compatibility for Table and other plugins

0 votes
Migration Bot 9000 October 13, 2011

Thanks Bob for the reply. Just a clarification.

Our approach with 4.0 is to ensure that macros in existing content continue to work after the upgrade to 4.0.

The use case in this discussion thread is around insertion of macros in new content created after the upgrade. For a macro to appear in autocomplete or in the macro browser, a plugin author must update their plugin. Documentation on how do this can be found here. These instructions have been available since Confluence 3.0, and we encourage all plugin authors to make this change.

Most macros marked as 3.5.x compatible on the plugin exchange should work in 4.0. However, as Bob mentioned, to insert them, you'll need to use the "Insert Wiki Markup Dialog".

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 21, 2011

Dave, my comment wasn't about plugin authors, but, how general admins/users figure out how migration mode works and the limitations with that. Admins have no way of knowing which is which for macros.

Migration Bot 9000 October 23, 2011

Bob,

If a plugin is marked as only 3.5.x on PAC, the implication for an administrator is that it most likely will work in what you define as "migration mode" and insertable via the "Insert Wiki Markup Dialog".

A plugin marked as 4.0.x compatible on PAC will work and should be insertable via autocomplete and the macro browser.

Admittedly, this is is not enforced on PAC.

Bob Swift OSS (Bob Swift Atlassian Apps)
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 23, 2011

Probably not the place for this discussion, but, I was not aware of any guidance provided on this. I mark 4.0 compatible once it successfully is tested on Confluence 4.0 in migration mode. This enables easy UPM install when testing migration, etc.... UPM doesn't have an option to easily find/install plugins that are not marked compatible.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events