Overriding Conditional Navigation
In certain cases, you may want to override conditional navigation that is configured for a content reference.
You can also override conditional navigation during pre processing and during post processing. The following table describes pre-processing and post-processing in conditional navigation:
Field or Control
Pre-processing refers to the execution of code at the time of page or URL generation at the application server layer. That is, the factors required for conditional navigation and the conditions specified for alternate content references are evaluated at the time of page or URL generation.
Post-processing refers to the evaluation of factors and conditions for a given content reference at the web server layer. For example, when a user receives an email notification and clicks on the link, the factors and conditions are evaluated at the web server layer to determine whether a classic page or a fluid page should be displayed.
Important! Post-processing is performed on URLs that use the psp (portal) servlet only. No post-processing is performed on URLs that use the psc (content) servlet. Therefore, ensure that any URLs provided to users are constructed using psp and not psc.
Overriding Conditional Navigation at the Component Level
Conditional navigation must not be applicable for configuration pages that are used by administrators, for example, Structure and Content, Tree Manager, Query Drill Down. You can override conditional navigation at the component level by using the OverrideConditionalNav built-in function.
/* The default value is %CNAV_SkipAll. */ OverrideConditionalNav();
Note: This built-in function must be invoked as the first executable line in the component PreBuild event.
Overriding Conditional Navigation During Pre Processing
You can also use the OverrideConditionalNav built-in function to suppress conditional navigation processing by other PeopleCode operations. The following code excerpt illustrates how you can override conditional navigation for a particular code segment rather than for the life of the program.
In the following code snippet, conditional navigation is ignored by the GenerateComponentPortalURL function:
OverrideConditionalNav(%CNAV_SkipAll); &URL = GenerateComponentPortalURL(%Portal,%Node,MenuName. "ROLE_MANAGER", "GBL", Component."HR_PROMOTE_APPR","",""); OverrideConditionalNav(%CNAV_RestoreAll); SendEmail(&URL);
Note: You must re-enable conditional navigation for the remainder of the program’s execution.
Overriding Conditional Navigation During Pre Processing and Post Processing
Certain circumstances require that conditional navigation be overridden both during pre-processing and at some future point whenever a user accesses a URL. To ensure that the generated URL always skips the specified conditional navigation settings, you can post-process this URL to append the skipcnav query string parameter.
The following example temporarily disables conditional navigation to generate a URL to a classic component. Then, conditional navigation is re-enabled for the remainder of the program’s execution. However, conditional navigation could be invoked at a later date whenever the generated link is clicked. Therefore, post-processing of the generated URL appends the skipcnav query string parameter to the URL to ensure that conditional navigation is always ignored for every user who clicks the link in every situation.
/* Disable conditional navigation before generating the URL. */ OverrideConditionalNav(); &URL = GenerateComponentPortalURL(%Portal, %Node, MenuName."ROLE_MANAGER", "GBL", Component."HR_PROMOTE_APPR", "", ""); /* IMPORTANT: Re-enable conditional navigation */ OverrideConditionalNav(%CNAV_RestoreAll); &URL = &URL | "?Action=U&BUSINESS_UNIT=US100&REQ_ID=0000000067"; /* Post-processing ensures that CN is skipped when the user clicks the link. */ &URL = &URL | "&skipcnav=1"; /* Invoke MCFOutboundEmail.Send to send the email including the generated URL */ ...
The skipcnav query string parameter takes the same integer values that are valid for the mode parameter of the OverrideConditionalNav function. This includes the ability to combine two values by using their sum as the integer value. See the mode parameter of the OverrideConditionalNav function for more information.