[PAGES-70] Regarding page (script) rendering: Remove warn message when not rendering a 'cma:area' but a component directly in a page script. Created: 11/Apr/16  Updated: 19/May/22  Resolved: 19/May/22

Status: Closed
Project: Magnolia pages module
Component/s: None
Affects Version/s: 5.4.4
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Christian Ringele Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File TemplateWarnMessage.png    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

There are many situations in real projects, where page scripts needs to render components from another page.

Situations where there are news pages in a dedicated top level tree in "website" workspace which then get concretely linked by other pages that rendered their content/components.
Like a news pages pool (I'm aware that its explicit not a news content-app, as the content of such a news is different on every news page).

Many things can be achieved, by rendering areas (their components) from other pages.

Here a code example form the page script for reproducing the message:

<!DOCTYPE html>
<html xml:lang="en" lang="en" class="no-js">

    <head>
        [@cms.page /]
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <link rel="stylesheet" href="${ctx.contextPath}/.resources/training-templating-basic/webresources/bootstrap.css" media="screen">
    </head>
    
    <body>
        <div class="container">
            <div class="panel panel-info">
                <div class="panel-heading">
                    <h3 class="panel-title">${content.title!"No title saved yet"}</h3>
                </div>
                <div class="panel-body">
                    <p>${content.abstract!"No abstract saved yet"}</p>
                </div>
            </div>
            
            [#-- this soul be a dynamic link fetched form 'content' to such a news taget page --]
            [#assign areaNode = cmsfn.contentByPath("/travel/about/company/main")! /]

            [#-- this is the main part, rendering the components of another page. --]
            [#list cmsfn.children(areaNode) as componentNodeOfTheArea]
                [@cms.component content=componentNodeOfTheArea /]
            [/#list]

        </div>
    </body>
    
</html>

See the attached print screen to see the message.



 Comments   
Comment by Christian Ringele [ 14/Jun/16 ]

Or imagine just having a page script including some JS for an Angular based page.
No need for an area.

The editor will always get this pup up.

Comment by Roman Kovařík [ 19/May/22 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

Thank you,
The Magnolia Team

Generated at Mon Feb 12 06:15:20 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.