Two existing (static) pages should be linked by using a 'direct' Link. This is achieved by the following steps:
[[#wd DisplayAnythingRenderer { /AnythingInfo { "<center><h1>Welcome on the first page of COAST</h1></center>" } }]]and e.g. AnotherPage.html:
[[#wd DisplayAnythingRenderer { /AnythingInfo { "<center><h1>Welcome on the Another page of COAST</h1></center>" } }]]
[[#wd DisplayAnythingRenderer { /AnythingInfo { "{" " /Body {" " /Form {" " /Method "GET"" " /Action "GoToInfoPage"" " /TemplateName "FirstPage" #HTML filename" " }" " }" "}" } }]]Content of file AnotherPage.any:
[[#wd DisplayAnythingRenderer { /AnythingInfo { "{" " /Body {" " /HTML {" " /TemplateName "AnotherPage" #HTML filename" " }" " }" "}" } }]]
Note: It is not necessary in general to create a configuration file for each content page you want to display. Using more active content allows you to generate a myriad of pages with a single configuration (and some kind of more dynamic action). See other recipes.
[[#wd DisplayAnythingRenderer { /AnythingInfo { "/Pages {" " # subclasses for "Page"" " /Page {" " "FirstPage" "AnotherPage"" " }" "}" } }]]
[[#wd DisplayAnythingRenderer { /AnythingInfo { "<center><h1>Welcome on the first page of COAST</h1></center>" "<!-- LinkRenderer in FirstPage.html -->" "[[#wd Lookup AnotherLink ]]" } }]]New content of file AnotherPage.html:
[[#wd DisplayAnythingRenderer { /AnythingInfo { "<html>" " <head>" " <title>" " [[#wd ContextLookupRenderer PageTitle ]]" " </title>" " </head>" " <body>" " [[#wd Lookup SpecialLayout ]]" " <center><h1>Hello - This is my another Page</h1></center>" " <!-- LinkRenderer "FirstLink" specified in AnotherPage.any -->" " [[#wd Lookup FirstLink ]]" " </body>" "</html>" } }]]
[[#wd DisplayAnythingRenderer { /AnythingInfo { "#---- inserted Renderer Specification in FirstPage.any ---------------------" "/AnotherLink {" " /Link {" " /Action "GoAnotherPage"" " /Label {" " /String {" " /Default "I'm going to another Page"" " }" " }" " }" "}" "#---- inserted Renderer Specification in AnotherPage.any ---------------------" "/FirstLink {" " /Link {" " /Action "GoFirstPage"" " /Label {" " /String {" " /Default "Go to First Page"" " }" " }" " }" "}" } }]]
[[#wd DisplayAnythingRenderer { /AnythingInfo { "/Map {" " # the following actions are available for all pages" " /Default {" " /Home "FirstPage"" " /GoFirstPage "FirstPage" # action defined by link render with resulting page" " /GoAnotherPage "AnotherPage"" " }" "}" } }]]
This example shows a very simple method to link two (static) HTML pages by configuration the files Config.any, FirstPage.any/html, AnotherPage.any/html, and Role.any. No additional C++ code needs to be written for this example.
ContextLookupRenderer, LinkRenderer