Nivel 1
Nivel 2
Iniciar sesión en la comunidad
Iniciar sesión para ver todas las insignias
Hi all,
What is a Page Component in a Static Template?
I am reading that it is the main component on main page and all other components are separate from it.
With respect to the way we create in a specific folder for housing the component or in any other way, how does a Page Component in a Static Template differ from all other components?
Appreciate all your replies.
Thanks,
RK.
¡Resuelto! Ir a solución.
Los temas ayudan a categorizar el contenido de la comunidad e incrementan la posibilidad de encontrar contenido relevante.
Vistas
Respuestas
Total de me gusta
A Page Component in a Static Template is a fundamental building block that defines the structure of a page.
Here are some key points:
Main Component:
Static Template:
Component Hierarchy:
Purpose and Scope:
Location and Organization:
Rendering and Logic:
Template Association:
Here is a simplified example of how a Page Component might be structured in AEM:
<!-- Page Component (e.g., /apps/my-project/components/page/base.html) -->
<div class="page">
<header class="header">
<!-- Header content -->
</header>
<main class="main-content">
<!-- Main content area where other components are rendered -->
<cq:include path="par" resourceType="foundation/components/parsys" />
</main>
<footer class="footer">
<!-- Footer content -->
</footer>
</div>
In this example, the Page Component includes the header, main content area, and footer. The main content area uses a parsys (paragraph system) to allow other components to be added dynamically.
Vistas
Respuestas
Total de me gusta
A Page Component in a Static Template is a fundamental building block that defines the structure of a page.
Here are some key points:
Main Component:
Static Template:
Component Hierarchy:
Purpose and Scope:
Location and Organization:
Rendering and Logic:
Template Association:
Here is a simplified example of how a Page Component might be structured in AEM:
<!-- Page Component (e.g., /apps/my-project/components/page/base.html) -->
<div class="page">
<header class="header">
<!-- Header content -->
</header>
<main class="main-content">
<!-- Main content area where other components are rendered -->
<cq:include path="par" resourceType="foundation/components/parsys" />
</main>
<footer class="footer">
<!-- Footer content -->
</footer>
</div>
In this example, the Page Component includes the header, main content area, and footer. The main content area uses a parsys (paragraph system) to allow other components to be added dynamically.
Vistas
Respuestas
Total de me gusta
Thanks @giuseppebag .
Excellent description.
Please confirm that the folder location does not matter for Page components and other components, as long as template makes the right reference to the page component and page component to other components.
Thanks,
RK.
Vistas
Respuestas
Total de me gusta
The components' paths are up to you; what's important is that the references inside the template definition point to the correct component path.
Vistas
Respuestas
Total de me gusta
Hi @nsvsrk ,
The physical folder location of the Page Component or any other component in your /apps/ structure does not technically matter, as long as the paths are correctly referenced in your template and component definitions.
Here’s how it works in practice:
Page Component Reference in Static Template
In a static template, the jcr:content node under the template defines the page component like this:
sling:resourceType = "my-project/components/page/base"
This path (my-project/components/page/base) must match the path to your actual page component under /apps/, for example:
/apps/my-project/components/page/base
So even if your folder structure is non-standard (like putting your page components under /apps/my-project/templates/components/), it will still work as long as the template points to the correct sling:resourceType.
Same Goes for Other Components
Other components (like text, image, etc.) can live anywhere in your project usually under something like:
/apps/my-project/components/content/
When they’re used in a page (via parsys or container), they’re referenced by their full sling:resourceType, like:
<cq:include path="par" resourceType="my-project/components/content/text"/>
So again, location doesn’t affect functionality only the resource type reference does.
Regards,
Amit
Vistas
Respuestas
Total de me gusta
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas
Vistas
me gusta
Respuestas