How to Create a "Last Added Instances" Module with Joomla CCK

Want to display the latest added items on your Joomla website automatically? With Joomla CCK Website Builder, you can create a "Last Added Instances" layout and display it as a module wherever you need it.

For example, you can use this feature to show the latest properties on a real estate website, recently added products in an online catalog, or the newest listings in a directory. The best part is that you don't need to update the list manually. By configuring the layout to sort instances by their ID in descending order, you can display the most recently added instances first.

In this tutorial, we'll show you how to create a "Last Added Instances" layout, configure the necessary fields, and display it on your website using the Joomla CCK Layout module.

How Can You Display a Joomla CCK Layout?

Joomla CCK Website Builder includes a Layout Manager that allows you to create different types of layouts for your website. Once you've created a layout, you can display it in several ways:

  • Joomla CCK Menu Item: Display the layout as a separate page on your website.
  • Joomla Article: Insert the layout into an article using a shortcode.
  • Joomla Custom HTML Module: Display a layout in a module using the appropriate shortcode.
  • Joomla CCK Layout Module: Use the built-in CCK module to display a layout in a selected module position.

In this tutorial, we'll use the Joomla CCK Layout module to display our "Last Added Instances" layout. Let's get started!

Step 1: Create a "Last Added Instances" Layout

First, open the Joomla Administrator panel and go to the Joomla CCK Layout Manager. Create a new layout using one of the following layout types:

  • CCK All Instances Layout.
  • Joomla CCK Category Layout.
Website Builder - Joomla CCK, add-layout-front-end

Choose the type that best suits your website and the content you want to display. For example, if you want to show the latest properties or products, you can create a layout that displays the corresponding instances.

After creating the layout, you'll need to configure its sorting options so that the newest items appear first.

Step 2: Add and Configure the "Order By" Field

To display the latest added instances, we need to configure the Order By field. This field determines how the instances are sorted in your layout. Open your layout settings and add the Order By field. Then configure the following options.

Default field for order: "ID";

Order by: "DESC";

Instance fields for order: "ID".

These settings are important:

  • ID identifies each instance.
  • DESC means descending order, so instances with higher IDs appear first.
  • Selecting ID as the instance field for ordering tells Joomla CCK which field to use for sorting.
Website Builder - Joomla CCK, show order_by field

As a result, the layout will display instances with higher IDs before those with lower IDs. This is generally a convenient way to show recently added instances first, assuming new instances receive higher IDs.

Important: Be careful when configuring the Instance fields for order option. According to this setup, you should select only the ID field. If you select more than one field, the Order By field may appear in the module.

Once you've configured these settings, your layout is ready to sort instances by ID in descending order.

Step 3: Configure the Layout Form Settings

Now we need to decide how many instances should appear in our module. Open the layout's Form Settings and find the field: Number of displayed instances.

OS cck - add all instances layout

Use this setting to specify how many items you want to show. For example, you could display:

  • 3 recently added properties;
  • 4 latest products;
  • 5 newest listings;
  • 6 recently added items in a directory.

Choose a number that fits your website design and the available space. Displaying a few recent items can be a great way to highlight new content without taking up too much room on the page. After configuring the number of displayed instances, save your layout.

Step 4: Display the "Last Added Instances" Layout

Your layout is now configured. The final step is to display it on your website. For this tutorial, we'll use the Joomla CCK Layout module. Go to: Content → Site Modules → New. Choose the module type: CCK Display Layout.

Open the module settings and select the "Last Added Instances" layout you created in the previous steps. Next, configure the module settings:

  • 1. Enter a module title, such as Last Added Items or Recently Added Properties.
  • 2. Select the module position where you want the layout to appear.
  • 3. Set the module status to Published.
  • 4. Open the Menu Assignment tab and choose the pages where the module should be displayed.
  • 5. Save your module.

Now open your website and visit one of the selected pages. Your "Last Added Instances" module should display the instances according to the sorting and display settings you configured.

Other Ways to Display Your Layout

Remember, the Joomla CCK Layout module is not the only way to use your layout. You can also display your layout using:

  • A Joomla CCK Menu Item;
  • A shortcode inside a Joomla article;
  • A Joomla Custom HTML module.

This flexibility allows you to place the same type of layout in different parts of your website, depending on your needs. For example, you could display the latest properties on your homepage using a module and create a separate page showing all properties using a Joomla CCK Menu Item.

Website Builder - Joomla CCK, add all instances layout

Creating a Last Added Instances module with Joomla CCK is a simple way to keep your website content fresh and highlight recently added items. With Website Builder - Joomla CCK, you can create reusable layouts and display them wherever you need them. Use this feature to highlight new products, properties, listings, or other content and make it easier for visitors to discover what's new on your website.

Other documentations of Joomla CCK website builder:


Ordasoft website development company

»