Mastering Data Modeling with Liferay Objects

Course Overview

Implementing Display Pages for Individual Object Entries

In addition to displaying lists of object entries, applications often require detailed pages for individual entries. For example, Clarity's apps need entry display pages that users can access from their overview pages. These pages should enable users to review details, make edits, or execute object actions for individual entries. Here you'll learn how you can design these experiences using Liferay's page builder tools, including display page templates and information templates.

Understanding Display Page Templates

Display page templates define structures for displaying content at a dedicated URL. When you create or upload content items, Liferay generates a unique friendly URL for accessing it. However, you can only use this URL to view the content if you create one of these templates for displaying it. Display pages are built using the same UI and features as content pages. With these templates, you can establish a consistent visual style for different types of content.

Display page templates define structures for displaying content at a dedicated URL.

These no-code layouts are ideal for building displays promoting data visibility and user navigation, enabling multi-page experiences that transfer context between pages about individual entries.

Understanding Information Templates

With information templates, you can create FreeMarker templates for supported content types (e.g., web contents, documents, categories, objects). These templates offer a powerful way to customize how content is rendered within fragments and pages, ensuring a consistent style and presentation across your site.

Once you’ve created an information template, you can map fragments to it for rendering individual content items using your template. Additionally, developers can use FreeMarker scripting in these templates for more precise control over content presentation. See Using Information Templates for more information.

Information templates offer powerful and flexible customization options, but you should use them with caution. These templates are primarily for rendering content. So developers should avoid incorporating complex logic or unnecessary data fetching, since this can negatively impact performance and introduce difficult-to-debug errors.

Best Practices to Display Object Entries With Templates

When working with display page templates and information templates to display object entries, consider these best practices:

  • Prioritize Data Modeling: Ensure object structures are complete (including all fields and relationship) before building display page templates or information templates. This streamlines the design process and promotes consistency.

  • Use Information Templates Responsibly: Only use information templates when complex field rendering is necessary. Poorly optimized FreeMarker code can impact page performance, so keep scripts streamlined and avoid excessive data processing.

  • Test Across Devices: Test your display page templates and information templates across multiple devices to ensure responsive design and maintain accessibility.

  • Maintain Consistent Layouts: For similar object types, keep layouts consistent to provide a cohesive and intuitive user experience.

Use display page templates with fragments whenever possible. While information templates offer greater control over data display, use them with caution because of their potential performance impact.

Implementing Clarity’s Apps

Clarity can use display page templates with fragments to implement detail pages for individual object entries. For the distributor management app, Clarity wants to enable users to access entry details from the entry collection displays. To achieve this, they can create display page templates for the Distributor Application and Application Evaluation objects. Then they can add fragments to the template and map the fragments to object fields. Additionally, they can add buttons and map them to object actions for triggering actions for the entry, such as changing its state or creating business accounts.

Clarity can use display page templates with fragments to implement detail pages for individual object entries.

For their ticketing app, Clarity can create distinct display pages for customers and support workers using separate display page templates. These pages will present details for individual tickets, including their status, related information, and attachments. By tailoring the content and functionality of each page to the specific needs of customers and support workers, Clarity can provide more focused and efficient user experiences.

Conclusion

Templates render individual object entries or their edit forms with consistent visual styling, creating engaging experiences using Liferay’s page builder tools. Display page templates are Liferay’s no-code approach to create flexible pages at dedicated URLs, while information templates extend that flexibility by empowering developers to customize field presentations with FreeMarker. By choosing the right tool for your needs, you can create streamlined, functional, and engaging interfaces for any use case.

Next, you’ll put this knowledge into action creating Clarity’s templates for individual object entries.

  • Understanding Display Page Templates

  • Understanding Information Templates

  • Best Practices to Display Object Entries With Templates

  • Implementing Clarity’s Apps

  • Conclusion

Loading Knowledge

Capabilities

Product

Education

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy