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.
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:
In this tutorial, we'll use the Joomla CCK Layout module to display our "Last Added Instances" layout. Let's get started!
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:
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.
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:
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.
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.
Use this setting to specify how many items you want to show. For example, you could display:
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.
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:
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.
Remember, the Joomla CCK Layout module is not the only way to use your layout. You can also display your layout using:
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.
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.