b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Back-office Reference
  3. Collections
  4. Settings
  5. Item types
  6. Custom Fields

Custom Fields

You will find an example of a post with custom fields when you install b2evolution with the demo content:

Custom Fields

Defining custom fields

You can define custom fields in the Item Type Form.

Custom fields can have different types: numbers (floating-point numbers with double precision), text strings (varchars), URLs, text, etc.

Note about numbers: Although you could store numbers as text strings, storing them in number fields will make a difference when you try to sort posts based on the numbers stored here (numbers will sort as 1, 2, 3, 9, 10, 11 whereas text strings would sort as 1, 10, 11, 2, 3, 9).

You can define as many custom fields of each type as you want and give them a name each. Each custom field has a field index that can be generated from the field name. The field index is the trimmed lowercase value of the field name where the white spaces are converted to one single underline character. Field indexes must be unique in a collection ( this way field names are also unique ).

Sample field names and corresponding field indexes:

  • ‘Color’ => color
  • ‘Name of custom field’ => name_of_custom_field
  • ‘Max speed (km/h)’ => max_speed_km_h

Entering data into custom fields

The fields defined here will appear in the Custom Fields section of the Item Edit Screen.

Custom Fields

Displaying the data entered in custom fields

There are 3 ways to display custom fields:

  • With a widget: Item Custom Fields Widget
  • From within the post contents, by using Custom Fields Short Tags
  • From within a skin template, with PHP code: Displaying Custom Fields in a Template
Tags: 7.0.2
Created by fatimahnasra • Last edit by fplanque on 2019-12-17 02:17 • •

No feedback yet

On this page

  • Defining custom fields
  • Entering data into custom fields
  • Displaying the data entered in custom fields

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
    • Site
    • Collections
      • Collection Dashboard
      • Contents
      • Comments
      • Categories
      • Features
      • Skins
      • Widgets
      • Settings
        • General
        • URLs
        • SEO
        • Item types
          • Item Types
          • Custom Fields
          • Item Type form
        • Item Statuses
        • Advanced
        • Advanced Permissions
        • Plugins
        • Common Settings
      • Creating a new collection
    • Files
    • Analytics
    • Users
    • Messages
    • Emails
    • System
    • Working with Results Tables
  • Developer Reference
  • Operations Reference
  • Advanced Topics
  • Glossary
  • Archives
Photo albums software

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque