Pages, Templates, and Layouts in Advantage CSP: A Development Guide

Front-end Components

Frontend Components

The frontend hierarchy in Advantage CSP follows a structured flow from the Masterpage/page level down to "Layouts" that consist of "zones" and further down to "Modules" that utilize a grid system to present content.

Advantage MasterPage (AdvantageMasterPage)

An optional ASP.NET MasterPage tailored for the Advantage CSP framework, inheriting from System.Web.UI.MasterPage. It facilitates easier integration with the framework and enhances interaction with AdvantagePageTemplates by extending the base functionality of ASP.NET's MasterPage. Member Properties: Includes properties like AdvantagePage, ConfigurationEngine, CSPNonce, CurrentDomain, and others, which provide essential context and configurations specific to the page being served.

Advantage Page Template (AdvantagePageTemplate)

An ASP.NET page that inherits from System.Web.UI.Page, designed to work within the Advantage CSP framework.It offers extended functionalities to interact smoothly with various components of AdvantageCSP, like site settings, module engine, navigation engine, and page content.Interactions: This includes interactions with site settings, configuration, modules, navigation, and page management, facilitating access to domain-specific settings, language preferences, navigation elements, and page content.
 

Image

 

Hierarchical Structure


The text highlights a hierarchical flow from a high-level MasterPage or page level down to finer details. This structure is essential for organizing the front-end of a web application, ensuring that pages are assembled in a modular and manageable way.
Layouts and Zones: These serve as containers within pages that dictate how content is organized and displayed. Layouts define the overall arrangement of content and can contain multiple zones, which are specific areas where content can be placed.
Modules and Grid System: Modules are reusable components that display content within the confines of a zone. They leverage a grid system for layout, which allows for responsive design and ensures that content is well-organized and visually appealing across different screen sizes.

Key Features

The framework's design emphasizes modularity, flexibility, and ease of integration with existing ASP.NET projects.
By inheriting and extending core ASP.NET classes (System.Web.UI.MasterPage and System.Web.UI.Page), it provides a streamlined way to incorporate advanced features and custom functionalities tailored to the needs of the Advantage CSP environment.
Properties like CurrentDomain, CurrentLanguage, IsPreview, and ModuleEngine offer granular control over the rendering and behavior of pages, making it easier to create dynamic, multi-lingual, and customizable web applications.

Conclusion

The Advantage CSP framework offers a structured and efficient way to develop front-end components for ASP.NET applications, with a focus on modular design, easy integration, and enhanced functionality. By understanding and utilizing these components, developers can build more robust, flexible, and user-friendly web applications.

 

 

Advantage MasterPage

AdvantageMasterPage Documentation

Methods & Properties

The AdvantageMasterPage is an optional ASP.NET MasterPage that inherits from System.Web.UI.MasterPage. It is designed to facilitate integration with the Advantage CSP framework.

Overview

The AdvantageMasterPage serves as an optional ASP.NET MasterPage intended for use within the Advantage CSP framework. It extends the functionality provided by System.Web.UI.MasterPage to enhance interaction with AdvantagePageTemplates.

Member Properties

The AdvantageMasterPage includes the following member properties:

  • AdvantagePage: Gets the advantage page.
  • ConfigurationEngine: Gets the configuration engine.
  • CSPNonce:
  • CurrentDomain: Gets the current domain.
  • CurrentLanguage: Gets the current language.
  • IsPreview: Gets a value indicating whether this instance is in preview mode.
  • IsSearchAgent: Gets a value indicating whether this instance is a search agent.
  • LanguageAbreviation: Gets the language abbreviation.
  • ModuleEngine: Gets the module engine.
  • RenderMode: Gets the render mode.

Default Template Location

The default template location for AdvantageMasterPage is under your website's /Templates folder.

Advantage Page Template

AdvantagePageTemplate Documentation

Methods & Properties

The AdvantagePageTemplate is an ASP.NET page that inherits from System.Web.UI.Page. It is designed to interact with the AdvantageCSP framework, providing seamless integration with various components.

Overview

The AdvantagePageTemplate serves as an ASP.NET page intended for use within the AdvantageCSP framework. It extends the functionality provided by System.Web.UI.Page to enhance interaction with AdvantageCSP components.

Interactions with AdvantageCSP Framework

  • SiteSettings: Provides access to the site settings module defined for the domain.
  • ConfigurationEngine: Reference to the AdvantageConfigurationEngine.
  • ModuleEngine: Reference to the AdvantageModuleEngine.
  • NavigationEngine: Reference to the AdvantageModuleEngine.
  • PageEngine: Reference to the AdvantageModuleEngine.
  • GetNavigations: Provides access to the navigations from the PageManagement.
  • CurrentDomain: Reference to the current domain.
  • CurrentLanguage: Reference to the current language.
  • CurrentSitePage: Reference to the SitePage (page content) that is being rendered.
  • CurrentNavigationPage: Reference to the Navigation that is being rendered.
  • CurrentSql: Reference to the current Advantage SQL connection context.

 

Methods

Name Description
CheckSSL Checks if the current page is being served over SSL (Secure Sockets Layer).
Dispose Releases all resources used by this instance.
GetNavigations Retrieves navigation links or paths based on specified criteria, aiding in the dynamic generation of site menus or navigation structures.
GetParameter Extracts and returns a parameter value from the query string of the current request.
LanguagePages Handles the language-specific rendering or organization of pages, potentially adjusting content based on the current language setting.
Modules Processes or manages modules related to a specified domain identifier, likely involving loading or rendering module content dynamically.
RegisterBottomScript (overloaded) Adds JavaScript or CSS content to the bottom of the page, useful for ensuring that scripts run after the page has loaded or for late-loading styles.
registerKeepAlive Possibly maintains or extends a session or connection alive, useful for web applications requiring long-lived connections.
RegisterTopScript (overloaded) Inserts JavaScript or CSS content at the top of the page, which is useful for defining styles or scripts that need to be loaded early in the page rendering process.
RenderControlContent Renders the content of a specific web control, possibly involving processing or manipulating the control's output before it is sent to the client.
SearchIndexUsingBrowserInstance Instructs the search indexing process to use a browser instance for rendering pages, allowing JavaScript and events to be processed. This approach may introduce overhead but is necessary for pages reliant on client-side scripting for content generation.
SetOpenGraph Configures Open Graph tags for the page, enhancing social media sharing capabilities by specifying how titles, descriptions, images, and more appear in shares.
SiteSettings() Retrieves custom site settings specific to the domain, allowing for domain-specific configurations to be applied dynamically.

 

Properties

Name Description
AdvantagePageDescription Gets or sets a descriptive text for the advantage page, which might be used for SEO or as a summary for the page.
AdvantagePageName Gets or sets the name of the advantage page, likely used for identifying pages within the site or for navigation.
AnalyticsCode Gets or sets the analytics tracking code, enabling site usage tracking and analytics capabilities.
ConfigurationEngine Provides access to the configuration engine, centralizing site configuration and settings management.
ContainerControl References the container control, possibly a parent control that holds other nested web controls.
CSPNonce Provides a nonce for the Content-Security-Policy header, enhancing security against certain attacks.
CurrentDomain Retrieves the domain currently being accessed, useful for multi-domain setups or domain-specific logic.
CurrentLanguage Indicates the language setting for the current session or page, facilitating multilingual content management.
CurrentNavigationPage Provides information about the currently rendered navigation page, aiding in dynamic navigation updates.
CurrentSitePage Accesses the current site page's content or settings, essential for rendering and customizing page content.
CurrentSql Grants access to the current SQL connection context, enabling database interactions specific to the current request.
DatabaseCacheManager Accesses the database cache manager, optimizing data retrieval and storage by caching domain/language-specific items.
Domain Retrieves the domain information, critical for applications that operate across multiple domains.

Advantage Layout Control

AdvantageLayoutControl Documentation

Members & Properties

The AdvantageLayoutControl is an ASP.NET control designed to manage layout within Advantage CSP pages. It provides functionalities for organizing and structuring content within a page layout.

An alternative method for creating layouts is to use the Dynamic Layout Manager in the CSP admin. (See documentation here)

Overview

The AdvantageLayoutControl offers a flexible approach to designing page layouts within the Advantage CSP framework. It allows developers to define and manage various sections of a page, such as headers, footers, sidebars, and content areas.

Key Features

  • Organized Layout: Allows for easy structuring of page layout with different sections.
  • Customizable: Provides options for customization, allowing developers to define layout according to specific requirements.
  • Responsive Design: Supports responsive design principles, ensuring layouts adapt to different screen sizes and devices.
  • Integration: Seamlessly integrates with other Advantage CSP components and modules.

Usage

To use the AdvantageLayoutControl, simply include it within your ASP.NET page markup. You can then define the layout structure by adding child controls and setting properties as needed  for each section of the page (e.g., header, footer, sidebar) and configuring their properties to meet the design criteria.

Developers can define the layout statically in the ASPX page or dynamically through code-behind, offering further flexibility in how layouts are constructed and manipulated. The control's properties and child controls dictate the final appearance and structure of the page, allowing for detailed control over the layout.

Example

<%@ Control Language="C#" AutoEventWireup="true"  Inherits="AdvantageCMS.Core.Common.BaseClasses.AdvantageLayoutControl"  %>

<script runat="server">
    public override string AdvantageLayoutName{get { return "Full Width"; }}
    public override string AdvantageLayoutDescription { get { return ""; } }                 
</script>

<asp:Panel ID="pnlTopArea" ZoneName="Top Area" runat="server"></asp:Panel>

<asp:Panel ID="pnlMainArea" ZoneName="Main Area" runat="server"></asp:Panel>

Conclusion

The AdvantageLayoutControl is a powerful tool within the Advantage CSP framework, designed to ease the complexities of layout management in web development. Its emphasis on organization, customization, responsiveness, and seamless integration makes it a valuable asset for developers aiming to create sophisticated, user-friendly, and responsive websites.

Properties

The AdvantageLayoutControl provides the following properties:

Name Description
AdvantageLayoutDescription Gets the advantage layout description.
AdvantageLayoutName Gets the name of the advantage layout.
AdvantagePage Gets the advantage page.
Includes Gets or sets the includes.
Zones Gets the zones.
Back to Top Button