Extrafields in Cotonti — A Beginner's Guide.

This article is for people who have never worked with the Cotonti website management system before and want to understand extrafields. A beginner's guide.

0 Published Filed under: Cotonti Siena CMF > Cotonti - reading materials. Documentation.

Course plan for introduction to extrapolation in Cotonti using the example of the Page module (pages and articles)

  1. Introduction
  2. Part 1. What extrafields are — the essence and concept in simple words
  3. Part 2. Where extrafields are built into Cotonti and how they work
  4. Part 3. All thirteen field types: a detailed breakdown
  5. Part 4. Preparatory steps before creating an extrafield
  6. Part 5. Step-by-step creation of an extrafield for the Page module
  7. Part 6. How to output extrafields in templates
  8. Part 7. Practical examples for different types of websites
  9. Part 8. Common mistakes and how to solve them
  10. Part 9. Advanced techniques
  11. Part 10. Answers to beginner questions
  12. Conclusion

Introduction

This article is for people who have never worked with the Cotonti website management system before and want to understand extrafields. We won't use complex terminology, won't make you write code, and won't require knowledge of programming languages. All explanations are in simple words, with analogies, examples, and tables.

The material is structured so that you can read it sequentially, chapter by chapter. If you need an answer to a specific question — open the table of contents and jump to the section you need.

After studying this article, you will be able to:

  • Understand what extrafields are and why they're needed.
  • Independently create any extrafield for pages.
  • Output it in the site template.
  • Solve typical problems that arise when working with extrafields.

Part 1. What extrafields are — the essence and concept in simple words

Chapter 1.1. Everyday analogy: a wardrobe and a shelf

To understand the essence of extrafields, let's imagine an ordinary wardrobe. The wardrobe has several shelves: for shirts, for trousers, for shoes. These shelves are built into the design from the start — everyone who buys such a wardrobe has them. Nobody plans to change them.

But one day you bring home a collection of hats from vacation. There's no space for them in the wardrobe. What do you do? You nail on an additional shelf. This shelf wasn't provided by the manufacturer — you came up with it yourself for your specific task.

That additional shelf is an extrafield in the world of Cotonti. It's a field that wasn't in the standard data structure, but which you created yourself because you need it.

Another example: a job application form. The standard form has fields for "Last Name," "First Name," "Date of Birth," "Education." But your HR department additionally needs to know whether the candidate has a driver's license. You add an extra line to the form. That's also an extrafield — an additional field that you came up with.

Chapter 1.2. What a field in a database is

All information on a website is stored in a database. A database is a set of tables. Each table resembles an Excel sheet: there are rows (records) and columns (fields).

For example, the pages table (cot_pages) contains all the pages of your website. Each row is one page. Each column is a characteristic of the page.

Standard columns of the pages table:

ColumnWhat it contains
page_idUnique page number (auto-increment)
page_aliasAlternative page address (SEO-friendly URL)
page_statePublication state: 0 — draft, 1 — published, 2 — pending moderation
page_catCode of the category the page belongs to
page_titlePage title
page_descShort description
page_keywordsSEO keywords
page_metatitleMeta title tag
page_metadescMeta description tag
page_textMain page text
page_parserWhich parser to apply to the text
page_authorPage author
page_owneridPage owner's ID
page_dateCreation date (timestamp)
page_beginPublication start date
page_expirePublication end date
page_updatedLast update date
page_fileFlag indicating an attached file exists
page_urlPage address
page_sizePage size
page_countView counter
page_filecountNumber of attached files

As you can see, there's everything needed for a typical page: title, description, text, author, dates. But something might be missing. For example, if you sell products through the "Pages" module, where do you store the price? Where do you store the SKU? Where do you store the manufacturer? There are no standard fields for this. And that's where extrafields come to the rescue.

Chapter 1.3. How extrafields appear in the database

When you create an extrafield through the Cotonti admin panel, the following happens:

  1. A new column with the name you specified is added to the cot_pages table.
  2. A record describing this field (its type, settings, and which table it belongs to) is added to the service table cot_extra_fields.
  3. Cotonti starts automatically displaying this field in the page edit form.
  4. Cotonti automatically creates tags for outputting this field's value in the template.

Thus, the extrafield becomes a full-fledged part of the system. It behaves just like built-in fields: it can be filled in when creating a page, it can be output in a template, it can be changed during editing.

Schematically it looks like this:

Admin creates a field
        ↓
Record in cot_extra_fields
        ↓
ALTER TABLE cot_pages (adding a column)
        ↓
Field in the edit form
        ↓
Tag in the template (PAGE_FIELD_NAME)
        ↓
Value on the site

Chapter 1.4. Which entities can extrafields be added to

In Cotonti, extrafields can be added not only to pages, but also to other entities. The main ones are:

EntityTableWhat it storesUsage examples
Pagescot_pagesArticles, news, productsPrice, SKU, author, source
Userscot_usersProfilesSkype, Telegram, city, position
Structure categoriescot_structureSite sectionsIcon, color, SEO description
Market productscot_marketStore productsSpecifications, warranty
Forum topicscot_forum_topicsForum threadsImportance, status
Forum postscot_forum_postsForum messagesAttached file
Commentscot_comCommentsRating, status

In this article we'll focus on pages (cot_pages), because it's the most commonly used entity, especially on catalog and store websites.

Chapter 1.5. Why extrafields are needed: real examples

To better understand the scope of extrafields, let's look at a few scenarios.

Scenario 1. Online store on the Page module. You sell electronics. For each product page you need to specify: price, SKU, manufacturer, warranty period, stock availability, link to the manual. The standard Cotonti fields aren't enough. You create six extrafields.

Scenario 2. Travel blog. You write articles about different countries. For each article you'd like to specify: country, city, season, trip budget, duration. You create five extrafields.

Scenario 3. Real estate catalog. You publish apartment listings. You need to specify: area, number of rooms, floor, building type, balcony availability, price. You create six extrafields.

Scenario 4. News portal. You publish news. You want to specify: source, author, event city, event time. You create four extrafields.

Scenario 5. Photographer's portfolio. Each work has technical parameters: camera, lens, ISO, shutter speed, aperture. You create seven extrafields.

Scenario 6. Culinary website. Each recipe has: cooking time, number of servings, calories, difficulty. You create four extrafields.

In all these cases, extrafields are the only way to add the needed information without rewriting the system's core.

Chapter 1.6. What would happen without extrafields

If extrafields didn't exist, each such task would require:

  1. Editing the site's database structure manually — that is, going into MySQL via phpMyAdmin, adding columns, risking data loss.
  2. Writing code that would read and save these new columns.
  3. Editing templates to output the new data on the page.
  4. Redoing all the edits with every Cotonti update.

With extrafields, none of this is needed. The system itself creates the columns in the database, picks them up in the edit form, and generates tags for templates.

Chapter 1.7. Limitations of extrafields

To give the full picture, let's also mention the downsides:

  • The field type cannot be changed after creation. Created a field as a number — it stays a number forever. If you made a mistake, you'll have to delete the field and create it again, losing data.
  • Deleting a field deletes the data. If you delete an extrafield, all values stored in it are erased permanently.
  • Extrafields are not a replacement for table relationships. If you need a relationship between two entities (e.g., "a product belongs to a seller"), that's done with a different mechanism.
  • The interface is limited to field types. Only about thirteen types are available. If you need very complex input (a map, a code editor, multiple files with sorting), you'll need a separate plugin.
  • You can't make a dropdown list with dependencies. For example, "country → city" cannot be done through standard extrafields.

All these limitations aren't critical if you understand them in advance.


Part 2. Where extrafields are built into Cotonti and how they work

Chapter 2.1. General data storage scheme

Cotonti stores data in a MySQL database. Each entity has its own table:

EntityTable name (with site prefix)
Pagescot_pages
Userscot_users
Categoriescot_structure
Extrafields (descriptions)cot_extra_fields

When you create an extrafield for pages, two things happen:

  1. A record with your field's parameters appears in the cot_extra_fields table.
  2. A new column with the name you specified is automatically created in the cot_pages table.

All this happens "under the hood," the user only sees the result.

Chapter 2.2. The cot_extra_fields table

The cot_extra_fields table contains metadata about all extrafields. Conditionally, it can be represented like this:

FieldWhat it storesExample
field_locationWhich table it's attached tocot_pages
field_nameField nameproduct_price
field_typeField typecurrency
field_htmlHTML template for display<input …>
field_variantsValue variantsDraft, Published
field_paramsAdditional parameters0,1000
field_defaultDefault value0
field_requiredWhether it's required0 or 1
field_enabledWhether it's enabled0 or 1
field_parseParse HTML or notHTML or Text
field_descriptionField description"Product price"

This data is needed by the core to understand how to display the field, how to validate the data, and where to save it.

Chapter 2.3. What happens when a page is saved

When you open a page in the admin panel and fill in an extrafield, the following happens:

  1. Cotonti receives the data from the form.
  2. It validates it against the rules specified in the field's metadata (for example, whether it's a number, whether it falls within a range).
  3. It saves the values into the corresponding columns of the cot_pages table.

Every time a page is updated, extrafield values are updated just like standard fields.

Chapter 2.4. How tags for templates are formed

A template tag is formed from the field name by a simple rule:

Field name in the admin panelTemplate tag
product_price{PAGE_PRODUCT_PRICE}
author_name{PAGE_AUTHOR_NAME}
release_year{PAGE_RELEASE_YEAR}

Rule: the field name is converted to uppercase, PAGE_ is prepended, and everything is wrapped in curly braces.

Exception: if the field is created for another module, the prefix will be different. For example, USERS_ for users, MARKET_ for products.

Chapter 2.5. How Cotonti knows where to output the field

Cotonti doesn't know exactly where you want to insert the field. It doesn't "guess" the place. Therefore, all responsibility for placement lies with you: you need to open the template file in a text editor, find the right place, and insert the tag there.

This is both flexible (you can output the field anywhere on the page) and demanding (you need to understand how templates are structured).

Chapter 2.6. Scheme: the path of data from form to page

Page edit form
        ↓
    Cotonti core
        ↓
    Data validation
        ↓
    cot_pages table (extrafield columns)
        ↓
    page.tpl template
        ↓
    Final HTML on the site

This scheme helps to understand that every time data is changed in the form, the entire chain runs again.


Part 3. All thirteen field types: a detailed breakdown

Cotonti supports thirteen field types. Let's look at each.

Chapter 3.1. Input — single-line text

What it is. A standard text field where you can enter up to 255 characters.

What to use it for. Names, titles, short descriptions, codes, SKUs, links, authorship.

Example. Field "Article author" — you enter the name of the person who wrote the text.

Settings. No special parameters besides the name and description.

Limitations. Text only, 255 characters max. If you need multiline text, use textarea.

How it looks in the form. A simple input line.

How it looks on the site. Exactly what you entered, unchanged.

Chapter 3.2. InputInt — integer

What it is. A field where you can only enter whole numbers (no dots or commas).

What to use it for. Quantity, year, rating, age.

Example. Field "Stock quantity" — you can enter "150".

Settings. You can set a minimum and maximum value.

Limitations. Whole numbers only. For decimals, use double or currency.

How it looks in the form. An input line with a numeric keyboard on mobile.

How it looks on the site. The number, unchanged.

Chapter 3.3. Double — floating-point number

What it is. A field for numbers that have a fractional part.

What to use it for. Weight, volume, distance, coefficients.

Example. Field "Product weight, kg" — you can enter "2.45".

Settings. You can specify the number of decimal places.

Limitations. Not suitable for money — there's a separate currency type for that.

How it looks in the form. A regular input line, but with number validation.

How it looks on the site. The number, unchanged.

Chapter 3.4. Currency — monetary amount

What it is. A field specifically for money. It differs from double in that formatting is automatically applied to the value.

What to use it for. Prices, costs, budgets.

Example. Field "Price" — you enter "1500", and on the site it displays as "1500.00".

Settings. Number of decimal places (usually 2).

How it looks in the form. A regular input line.

How it looks on the site. A number with two decimal places.

Chapter 3.5. Textarea — multiline text

What it is. A large text input field where you can fit several paragraphs.

What to use it for. Short descriptions, specifications, comments, notes.

Example. Field "Package contents" — a list of what's included with the product.

Settings. You can specify the number of rows and columns for display.

Limitations. This is not a visual editor, but a simple text field. For formatted text, use Cotonti's standard fields with an editor enabled.

How it looks in the form. A large block for entering text.

How it looks on the site. Text with line breaks (if HTML is allowed).

Chapter 3.6. Select — dropdown list

What it is. A dropdown list from which you can choose only one option.

What to use it for. Statuses, categories, conditions, types.

Example. Field "Product condition" — options: "New," "Used," "Refurbished."

Settings. A list of variants, each variant on a new line in a special field.

Limitations. You can't select several values at once. For that, use checklistbox.

How it looks in the form. A dropdown list with one active option.

How it looks on the site. The text of the selected option.

Chapter 3.7. Checkbox — flag

What it is. A single checkbox that can be turned on or off.

What to use it for. Yes/no, on/off.

Example. Field "Featured" — if the box is checked, the product goes into the featured block.

Settings. None.

Limitations. Only two states. If you need several options, use radio.

How it looks in the form. A single checkbox that can be checked or unchecked.

How it looks on the site. 0 or 1. Usually used in conditions (IF).

Chapter 3.8. Radio — group of radio buttons

What it is. Several radio buttons from which you can choose one option.

What to use it for. When there are few options and you want them all visible at once.

Example. Field "Delivery type" — "Courier," "Mail," "Pickup."

Settings. List of variants.

Limitations. Not suitable for long lists — select is better for that.

How it looks in the form. Several round buttons, one of which is selected.

How it looks on the site. The text of the selected option.

Chapter 3.9. Datetime — date and time

What it is. A field for entering a date and time.

What to use it for. Event dates, deadlines.

Example. Field "Promotion start date" — chosen via a calendar.

Settings. Date display format, year range.

Limitations. Always includes both date and time. If you need only time, set the date conventionally.

How it looks in the form. Several dropdown lists (day, month, year, hour, minute).

How it looks on the site. A date in the specified format (e.g., 12.10.2026).

Chapter 3.10. Country — country

What it is. A dropdown list of countries standardized by the system.

What to use it for. Country of manufacture, country of delivery, citizenship.

Example. Field "Country of manufacture."

Settings. None — the country list is already built in.

How it looks in the form. A dropdown list with country names.

How it looks on the site. A two-letter country code.

Chapter 3.11. Range — integer within a range

What it is. A field where you can enter a whole number within specified bounds.

What to use it for. Ratings, scores, levels.

Example. Field "Product rating" — from 1 to 5.

Settings. Minimum and maximum.

How it looks in the form. A dropdown list with numbers in the range.

How it looks on the site. The number.

Chapter 3.12. Checklistbox — multi-select list

What it is. A list in which you can check several options at once.

What to use it for. Tags, categories, groups of characteristics.

Example. Field "Tags" — you can check "New," "Best seller," "Sale."

Settings. List of variants.

Limitations. It's more difficult to output values in templates — you need special loops.

How it looks in the form. Several checkboxes.

How it looks on the site. Values separated by commas.

Chapter 3.13. File — file upload

What it is. A field for uploading a file from your local computer.

What to use it for. Attaching PDF manuals, documents, images.

Example. Field "Manual" — a PDF file is attached.

Settings. Allowed formats, upload folder.

Limitations. For images, Cotonti's standard fields are usually used; file is for documents.

How it looks in the form. File selection button + delete checkbox.

How it looks on the site. A link to the file.


Part 4. Preparatory steps before creating an extrafield

Chapter 4.1. What you need to know before starting

Before creating extrafields, make sure you have:

  1. Access to the Cotonti admin panel. Admin login and password.
  2. Administrator rights. Not all users can create extrafields — you need administrator-level rights.
  3. Database backup. Be sure to make a backup before creating new fields.
  4. Understanding of your site's structure. Think about which fields you actually need.

Chapter 4.2. Creating a backup

A backup is sacred. Never neglect it. You can create a database backup:

  1. Through your hosting control panel (usually there's a "Backups" section).
  2. Through phpMyAdmin (database export).
  3. Through Cotonti plugins (e.g., dbbackup).

It's advisable to store the backup in three places: on the server, on your local computer, and in cloud storage.

Chapter 4.3. Planning extrafields

Before creating extrafields, make a list of the fields you need. For each field, define:

  • Field name (Latin letters, no spaces)
  • Field type
  • Description (what the user will see in the form)
  • Required or not
  • Where it will be used (in which template it will be output)

Example planning table:

NameTypeDescriptionWhere used
priceCurrencyProduct priceProduct card, product list
skuInputSKUProduct card
vendorInputManufacturerProduct card
warrantyInputIntWarranty (months)Product card
stockCheckboxIn stockProduct card, filter
manual_urlInputLink to manualProduct card

With such a table, the field creation process will go faster and without errors.

Chapter 4.4. Recommendations for field names

The field name is what will be used in the database and in templates. It should be:

  • In Latin letters.
  • Without spaces.
  • Without hyphens.
  • Without dots.
  • With underscores for separating words.
  • Meaningful.

Examples of good names:

  • product_price — product price
  • author_name — author name
  • event_date — event date
  • is_featured — featured

Examples of bad names:

  • field1 — unclear what's stored
  • temp — doesn't reflect the essence
  • abc — means nothing at all

Part 5. Step-by-step creation of an extrafield for the Page module

Step 1. Logging into the admin panel

  1. Open your site in a browser.
  2. Add /admin or /ru/admin to the address, depending on the site's language version.
  3. Enter the admin login and password.
  4. Click the "Log in" button.

Step 2. Going to the "Extrafields" section

  1. In the left menu, find the "Site management" section.
  2. Expand it.
  3. Select the "Extrafields" item.
  4. The direct link usually looks like https://your-site.com/admin/extrafields.

You'll land on a page with a list of all tables to which additional fields can be added.

Step 3. Selecting the pages table

A list of tables will open on the page. Find the cot_pages table in the list (in your installation, the prefix may differ, e.g., x92374_pages). This is the table of the "Pages" (Page) module.

Click on the table name. You'll go to the page for managing extrafields of that specific table.

Step 4. Examining existing fields

On the page that opens, you'll see a table with existing additional fields. In a standard Cotonti installation, there may be none — the table will be empty.

You'll also see a form for adding a new field. Usually it's located at the bottom of the page.

Step 5. Filling out the add form

The add form consists of several fields.

FieldWhat to enter
EnabledLeave the checkbox ticked
Field NameUnique, in Latin letters, e.g., product_price
DescriptionA clear name for the editor, e.g., "Product price"
Field HTML codeLeave empty — Cotonti will generate it
Field typeSelect from the list, e.g., currency
Selection valuesFill only for select/radio/checklistbox
ParametersFill only for numeric types and datetime
Default valueOptional
RequiredTick only if the field is critical

Step 6. Selecting the field type

To the right of or below the name and description block, there's a dropdown list "Field type" (Type). By default, input is selected. Click on it and choose the desired type.

After choosing the type, the form may rearrange: some additional fields will appear, others will disappear.

Step 7. Configuring additional parameters

Different field types require different parameters.

For Input — no additional parameters.

For InputInt:

ParameterDescription
MinimumMinimum value
MaximumMaximum value

For Currency:

ParameterDescription
Decimal placesUsually 2

For Double:

ParameterDescription
Decimal placesUsually 2-4

For Textarea:

ParameterDescription
WidthIn characters
HeightIn rows

For Select:

ParameterDescription
Selection valuesEach value on a new line

For Radio and Checklistbox:

ParameterDescription
Selection valuesEach value on a new line

For Datetime:

ParameterDescription
Year rangeFrom year and to year
FormatFor example, d.m.Y H:i

For Range:

ParameterDescription
MinimumMinimum value
MaximumMaximum value

For File:

ParameterDescription
Upload folderWhere to save the files
Allowed formatsFor example, pdf,doc,zip

Step 8. Saving the field

  1. Check all the filled-in fields.
  2. Click the "Save" or "Add" button.
  3. If everything is filled in correctly, the field will appear in the table of existing extrafields.

Step 9. Checking in the page edit form

  1. Go to the "Pages" section.
  2. Open any page for editing.
  3. Scroll down the form — you should see the new field.

Step 10. Filling in a value

Enter a test value in the new field and save the page. Nothing has changed on the site yet, because the template doesn't know about the new field. That's the next step.

Step 11. Creating the remaining fields

Repeat steps 5–10 for all planned fields.


Part 6. How to output extrafields in templates

Chapter 6.1. Understanding the template structure

Cotonti templates are located in your theme's folder. For the Page module, it's:

/themes/your_theme/modules/page/

Main files:

FilePurpose
page.tplViewing a single page
page.list.tplList of pages in a category
page.add.tplAdd form
page.edit.tplEdit form

Chapter 6.2. Tags for outputting extrafields

Cotonti automatically creates tags for each extrafield. The naming scheme is:

TagWhat it outputs
{PAGE_FIELD_NAME}Field value
{PAGE_FIELD_NAME_TITLE}Field description
{PAGE_FIELD_NAME_VALUE}Value (alternative tag)

For example, if you created a field named product_price, you can use this in the template:

{PAGE_PRODUCT_PRICE}

Chapter 6.3. Inserting the tag into the template

  1. Open the page.tpl file in any text editor.
  2. Find the place where you want to output the field.
  3. Insert the tag.

Example of outputting the price:

<div class="product-price">
    Price: {PAGE_PRODUCT_PRICE}
</div>

Example of outputting the author:

<div class="author">
    Author: {PAGE_AUTHOR_NAME}
</div>

Chapter 6.4. Conditional output

If a field may be empty, wrap it in a condition:

<!-- IF {PAGE_PRODUCT_PRICE} -->
<div class="product-price">
    Price: {PAGE_PRODUCT_PRICE}
</div>
<!-- ENDIF -->

Such code will only display the block if the field is filled in.

Chapter 6.5. Output with field description

<div class="extrafield">
    <strong>{PAGE_PRODUCT_PRICE_TITLE}:</strong>
    {PAGE_PRODUCT_PRICE}
</div>

If the field is described in the admin panel as "Product price," the site will show: "Product price: 1500.00."

Chapter 6.6. Loop through all extrafields

If you have many extrafields:

<!-- BEGIN: PAGE_EXTRAFLD -->
<div class="extrafield">
    <strong>{PAGE_EXTRAFLD_TITLE}:</strong>
    {PAGE_EXTRAFLD_VALUE}
</div>
<!-- END: PAGE_EXTRAFLD -->

This block will automatically loop through all filled-in fields of the page.

Chapter 6.7. Output in the pages list

In the page.list.tpl file, the tags are slightly different:

{PAGE_ROW_PRODUCT_PRICE}

Note the ROW_ in the middle. That's because in a list, each page is a separate loop row.

Chapter 6.8. Clearing the cache after changes

After editing the template:

  1. Save the file.
  2. Open the admin panel → "Site management" → "Cache" → "Disk cache."
  3. Click "Clear all."
  4. Open the page on the site and check the result.

Chapter 6.9. Tag formation scheme

Field name in admin panel: product_price
        ↓
Conversion: PRODUCT_PRICE (to uppercase)
        ↓
Adding prefix: PAGE_PRODUCT_PRICE
        ↓
Wrapping in braces: {PAGE_PRODUCT_PRICE}
        ↓
Insertion into the template

Part 7. Practical examples for different types of websites

Chapter 7.1. Online store on the Page module

Extrafields:

NameTypeDescription
product_priceCurrencyPrice
product_old_priceCurrencyOld price
product_skuInputSKU
product_brandInputBrand
product_warrantyInputIntWarranty, months
product_instockCheckboxIn stock

Output in the product card:

<h1>{PAGE_TITLE}</h1>
<!-- IF {PAGE_PRODUCT_SKU} -->
<div>SKU: {PAGE_PRODUCT_SKU}</div>
<!-- ENDIF -->
<!-- IF {PAGE_PRODUCT_BRAND} -->
<div>Brand: {PAGE_PRODUCT_BRAND}</div>
<!-- ENDIF -->
<!-- IF {PAGE_PRODUCT_PRICE} -->
<div>Price: {PAGE_PRODUCT_PRICE}</div>
<!-- ENDIF -->

Chapter 7.2. Travel blog

Extrafields:

NameTypeDescription
travel_countryCountryCountry
travel_cityInputCity
travel_seasonSelectSeason
travel_budgetCurrencyBudget
travel_daysInputIntDays

Values for travel_season:

Spring
Summer
Autumn
Winter
Year-round

Chapter 7.3. Real estate catalog

Extrafields:

NameTypeDescription
estate_areaDoubleArea
estate_roomsInputIntRooms
estate_floorInputIntFloor
estate_floors_totalInputIntTotal floors in the building
estate_has_balconyCheckboxBalcony
estate_priceCurrencyPrice

Chapter 7.4. Photographer's portfolio

Extrafields:

NameTypeDescription
photo_cameraInputCamera
photo_lensInputLens
photo_isoInputIntISO
photo_shutterInputShutter speed
photo_apertureInputAperture

Chapter 7.5. Culinary website

Extrafields:

NameTypeDescription
recipe_timeInputIntTime, min
recipe_portionsInputIntServings
recipe_caloriesInputIntCalories
recipe_difficultySelectDifficulty

Values for recipe_difficulty:

Easy
Medium
Hard

Part 8. Common mistakes and how to solve them

Error 1. Field doesn't display on the page

CauseSolution
Typo in the tag nameCheck the spelling and case
Field is not filled inFill it in the admin panel
Cache not clearedClear the cache
Wrong templateMake sure you're editing page.tpl, not another file

Error 2. Field doesn't display in the edit form

CauseSolution
Field is disabledTick the "Enabled" checkbox
Field created for another tableCheck field_location
No rightsLog in as a super administrator

Error 3. Field can't be created

CauseSolution
Name contains forbidden charactersOnly Latin letters, digits, underscore
Name is takenCome up with another one
No rightsCheck your group's rights

Error 4. Error when saving a page

CauseSolution
Value out of rangeCheck min/max
Invalid number formatUse a dot, not a comma
Value doesn't match the typeCheck your input

Error 5. Value displays incorrectly

CauseSolution
HTML code in the valueUse the correct filter
Date in timestamp formatConfigure the format in the parameters
Special charactersCheck the file encoding

Error 6. Field disappeared after an update

CauseSolution
Core updateCheck cot_extra_fields, restore from backup

Error 7. Field duplicated in the form

CauseSolution
Field created twiceDelete the duplicate
Plugin adds its own fieldDisable the plugin

Part 9. Advanced techniques

Chapter 9.1. Grouping fields by sections

If there are many extrafields, the edit form becomes unwieldy. One way is to use categories for grouping.

Chapter 9.2. Required fields

Make critical fields required so that authors don't forget to fill them in.

Chapter 9.3. Default values

For status fields, it's useful to set a default value: for example, when a new page is created, the status automatically becomes "Draft."

Chapter 9.4. Using for SEO

Extrafields can be used for SEO: outputting meta tags, descriptions, keywords.

Chapter 9.5. Output in other places on the site

Extrafields can be output not only on the page, but also in lists, widgets, and special blocks.

WhereTag prefix
Page (single)PAGE_
Pages listPAGE_ROW_
Widget on the home pageDepends on the widget

Chapter 9.6. Sorting and filtering

You can sort and filter pages by extrafields, but this requires special plugins or additional configuration.

Chapter 9.7. Exporting and importing values

If you have thousands of pages, filling in extrafields manually is inconvenient. There are two paths: direct work with the database or plugins for import.

Chapter 9.8. Backup

Before creating new extrafields, always back up the database.


Part 10. Answers to beginner questions

Question 1. How many extrafields can I create?

Technically — up to a thousand fields per table. Practically — no more than 20–30 is recommended, so as not to overload the edit form.

Question 2. Can extrafields be used in other modules?

Yes, each module has its own extrafields: users, forums, store.

Question 3. What if an extrafield is no longer needed?

You can disable the field or delete it. Disabling is safer — the data is preserved.

Question 4. How do I change the field type?

The field type cannot be changed after creation. You need to delete the old one and create a new one.

Question 5. Can I make an extrafield required?

Yes, there's a "Required" checkbox in the settings.

Question 6. What happens to extrafields when Cotonti is updated?

Extrafields are preserved during updates.

Question 7. How do I move extrafields to another site?

By exporting/importing the cot_extra_fields and cot_pages tables.

Question 8. Can extrafields be used in filters?

Yes, but this requires development or ready-made plugins.

Question 9. Can I create an extrafield via the API?

Yes, there's an API for creating fields.

Question 10. How do I optimize work with a large number of extrafields?

Tips: don't create unused fields, use caching, divide fields into groups.

Question 11. Do extrafields affect site speed?

One or two fields — no. Many fields (30+) can slow down data retrieval.

Question 12. How do I check that an extrafield works?

Create a page, fill in the field, save it, open the page.

Question 13. What if an extrafield displays in the wrong place?

Check the tag insertion point in the template.

Question 14. Can extrafields be styled?

Yes, you can assign a CSS class to each field.

Question 15. Do extrafields work in the mobile version?

Yes, if they're correctly inserted into the template.


Conclusion

Extrafields are a powerful and convenient Cotonti tool that allows you to expand a site's functionality without programming. With them, you can add any fields to pages, users, products, and other entities.

We've covered and hopefully helped find answers to the questions:

  • What are extrafields and why are they needed?
  • Which field types does Cotonti support?
  • How do I create an extrafield for the Page module?
  • How do I output an extrafield in templates?
  • What mistakes can occur and how do I solve them?
  • What advanced capabilities exist?

Main rules:

  1. Always make a backup before creating extrafields.
  2. Plan fields in advance.
  3. Give meaningful names.
  4. Clear the cache after changes.
  5. Use conditional output so that empty fields are not shown.

Ask any questions about extrafields in Cotonti on the forum!

No comments yet
Only registered users can post new comments
webitproff
webitproff

Online

Last logged: 2026-10-12 17:30

About me briefly
Support and development of web projects on the CMF Cotonti: private messengers via the website, open and closed small social networks, trading platforms and marketplaces, freelance and services exchange portal, catalogs of goods from wholesale suppliers, dropshipping platforms, online stores, and much more.
Telegram for messages
@webitproff
Telegram channel
@s/aBuyFILE
Public profile
  • Date published 2026-10-10 00:00
  • Updated 2026-10-12 16:30

Similar pages

API экстраполей в Cotonti (Extrafields API)
1 API экстраполей (Extrafields API)Экстраполя служат для дополнения определенными данными какие-либо сущности на сайте.
Файл extrafields.php в Cotonti
2 Файл extrafields.php в системной папке Cotonti CMF отвечает за управление дополнительными пользовательскими полями (их
Файл admin.extrafields.php в Cotonti CMF
3 Файл admin.extrafields.php в движке Cotonti CMF предназначен для управления дополнительными полями (extra fields) в
HTML-шаблон admin.extrafields.tpl в Cotonti
4 Файл шаблона admin.extrafields.tpl в контексте движка Cotonti CMF отвечает за отображение и обработку пользовательских
Модуль "Users", - users.extrafields.php в Cotonti CMF
5 Основное назначение файла Файл users.extrafields.php в Cotonti CMF представляет собой часть модуля для управления