Creating Article Custom Fields - Part 1

Views: 1016

This article will illustrate how to add custom fields to any page type in the Joomla! framework.

Core Joomla! extensions that have their own custom fields are:

We will show how to create and implement these custom fields directly into a module, category page, and custom (pre-made) layouts using real use cases found in this template.

Create New Article Custom Field

Creating a basic custom field (from the Admin Dashboard):

  • Content > Field Groups > New
  • We are going to title it 'Pricing
  • Save and Close
  • Content > Fields > New
  • Title it 'Price'
  • Select Filter 'Text'
  • Click on the 'Options' tab
  • Under 'Display Options', find the 'Automatic Display' field
  • Select 'Do not automatically display'
  • Save & Close

 

Create Article Layout Override

  • System > Site Templates
  • Select your active template (Site example is My Template)
  • Select the 'Create Overrides' Tab
  • Components> com_content > article (click)
  • This will create a new layout titled 'default' in your '/templates/html/com_content/article' directory
  • Rename this file to 'price' so the filename should be 'price.php'

 

Create New Article With Override

  • Content > Articles > New
  • Add a title 'Price Example'
  • Select the 'Options' Tab
  • Find 'Layout' Field and select the new layout you created: 'price'
  • Select the 'My Template' Tab
  • Find the 'Price' field you created earlier and enter '$450'
  • Save & Close

 

Conclusion

After following the steps above, the following items should be completed before moving to the next article:

  1. Article custom field group titled 'Pricing'
  2. Article custom field titled 'Price'
  3. Article layout override named 'price.php'
  4. New article using the 'price' layout file & a value of '$450' in the 'Price' field under the 'Pricing' tab

What Our Customers Say

"The greatness of Joomla is experienced when we call come together and squash all the bugs, eat pizza, and make Joomla better software for all!"

Simplify Your Web /

"The greatness of Joomla is experienced when Joomla folks from around the world get together in my home state of Florida!"

Creative People Consulting /

"The greatness of Joomla is experienced not in the classes and webinars, its the conversations before, during, and afterwards!"

RytechSites /