cancel
Showing results for 
Search instead for 
Did you mean: 

navigate to a new page from an aikau page

boneill
Star Contributor
Star Contributor
Hi Guys,

I have created a site default page to display a terms and conditions. The user must accept the terms and conditions before they are brought to their dashboard.  The new default page (disclaimer page) is created using Aikau.  On load it checks if the user has already agreed to the T&Cs.  At this point if they have I want to redirect them to the dashboard.  I cant figure out how to do it using aikau.  I have written a service widget which I can include on the page but I cant figure out how to call a method on the service widget that does the navigation for them.

Any suggestions?

Regards

Brian
2 REPLIES 2

ddraper
World-Class Innovator
World-Class Innovator
Hi Brian,

I saw this on IRC… you were asking about publishing on load, it is possible to define a "publishOnReady" array in your pages. Each entry in the array will be an object consisting of a publishTopic and publishPayload that should be published when the page first loads.

Regards,
Dave

<blockcode>
<javascript>
{
     name: "alfresco/lists/views/layouts/Cell",
     config: {
         additionalCssClasses: "mediumpad",
         widgets: [
             {
                 name: "alfresco/renderers/PropertyLink",
                 config: {
                     propertyToRender: "isActive",
                     publishTopic: "ALF_NAVIGATE_TO_PAGE",
                     publishPayloadType: "PROCESS",
                     useCurrentItemAsPayload: false,
                     publishPayloadModifiers: ["processCurrentItemTokens", "convertNodeRefToUrl"],
                     publishPayload: {
                         url: "workflow-details?workflowId={id}",
                         type: "SHARE_PAGE_RELATIVE",
                         target: "CURRENT"
                     }

                 }

                                      }
                                   ]
     }
}
</javascript>
</blockcode>

With "propertyLink" you can click, then

publishTopic: "ALF_NAVIGATE_TO_PAGE",    to tell him you want to navigate
and the url where you would like to go

you can add some cool stuff like <blockcode> target: "NEW"</blockcode> for oppening your new page in an other windows

http://dev.alfresco.com/resource/docs/aikau-jsdoc/topics.html#event:NAVIGATE_TO_PAGE