---
title: "Content Fields for J2Commerce"
description: "This plugin bridges Joomla's built-in Custom Fields system and J2Commerce product pages."
url: "https://docs.j2commerce.com/v6/apps-and-extensions/apps/contentfields"
markdown_url: "https://docs.j2commerce.com/v6/apps-and-extensions/apps/contentfields.md"
last_updated: "2026-11-06T14:28:59+00:00"
version: "J2Commerce 6"
breadcrumbs:
  - title: "Home"
    url: "https://docs.j2commerce.com/"
  - title: "J2Commerce 6"
    url: "https://docs.j2commerce.com/v6"
  - title: "Apps and Extensions"
    url: "https://docs.j2commerce.com/v6/apps-and-extensions"
  - title: "Apps"
    url: "https://docs.j2commerce.com/v6/apps-and-extensions/apps"
  - title: "Content Fields for J2Commerce"
    url: "https://docs.j2commerce.com/v6/apps-and-extensions/apps/contentfields"
---

# Content Fields for J2Commerce

This plugin bridges Joomla's built-in Custom Fields system and J2Commerce product pages. Once enabled, it reads the custom fields you already attach to your articles and injects them into product detail and category list views at the position you choose. No code changes are needed, except to place fields with Layout Slots.

This is a separate add-on available from the [Content Custom Fields](https://www.j2commerce.com/extensions/apps/content-custom-fields). It is not included with the core J2Commerce 6 component.

## What's New in J2Commerce 6

Version 6.0.0 is a full rewrite of the version 4 predecessor. Key differences:

- Native Joomla 6 MVC event system â€” no FOF 2 dependency, no jQuery.
- Bootstrap 5 accordion option wraps long field values in collapsible panels.
- Configurable **Accordion Threshold (characters)** lets you keep short values inline.
- **Debug Mode** writes a log to `administrator/logs/plg_j2commerce_app_contentfields.php` for troubleshooting field resolution.
- Ships with both en-US (default) and en-GB language files.
- Shortcode processor skips the Joomla Smart Search indexer context automatically to avoid polluting search indexes.

## Prerequisites

- J2Commerce 6.0 or later installed and enabled.
- At least one Joomla Article Custom Field created for the context `com_content.article` (details below).
- Your products must be linked to Joomla articles. Products sourced from something other than `com_content` will not have fields to display.

## Purchase and Download

**Step 1:** Go to the [J2Commerce website](https://www.j2commerce.com/extensions) -> **Apps**

**Step 2:** Locate **Content Fields** -> click **View Details** -> **Add to Cart** -> **Checkout**

**Step 3:** After purchase, open your account and go to **My Downloads**. Find **Social Media Sharing**, click **Available Versions** -> **View Files** -> **Download Now** to get the `app_socialmedia.zip` file.

## Install the App

In the Joomla Administrator, go to **System** **->** **Install** **->** **Extensions**.

Upload the `app_contentfields.zip` ZIP file or use the Install from URL option.

![Joomla System Dashboard with System in the sidebar and the Install Extensions link highlighted to open the extension installer](https://docs.j2commerce.com/images/docs/shared/install.webp)

## Enable the App

Once you have installed the App, you will need to enable it. There are **two** ways you can access the App.

**Option A:** Go to the **J2Commerce** icon at the top right corner **-> Apps -> Content Fields**

**Option B:** Go to **Components** on the left sidebar **-> J2Commerce -> Apps -> Content Fields**

![Joomla admin navigation to J2Commerce Apps: Components, J2Commerce, Apps in the sidebar and Apps in the J2Commerce menu highlighted, above the list of apps](https://docs.j2commerce.com/images/docs/shared/gift-wrap-apps.webp)

To help you narrow down the list, you can do a search for **Content Fields**, click theÂ **X,**Â and it will turn into a green checkmark. It is now enabled and ready for setup.

![J2Commerce Apps list searched for "content", with the search box and the Content Fields enabled status icon highlighted](https://docs.j2commerce.com/images/docs/shared/content-fields-enable.webp)

## Configuration

> **Tip:** Click the **Toggle Inline Help** button in the toolbar and the app will show a description below each field as you configure it.

![Content Fields plugin with Toggle Inline Help highlighted and the Display Method help text highlighted about shortcode tokens like field and fieldgroup](https://docs.j2commerce.com/images/docs/shared/content-fields-toggle.webp)

### Display Method

Controls *where* the fields are injected on the page. Choose the option that matches your layout goal.

![Content Fields plugin, Display Method dropdown open and highlighted with Shortcode, End of Product Description, Before Price, After Price and cart button positions listed](https://docs.j2commerce.com/images/docs/shared/content-fields-display-method.webp)

Belos shows the Disply methods and when to use them.

- **Shortcode:** You want to place fields at exact spots inside the article text using tokens.
- **End of Product Description:** Fields appear after the article description. Works with either the short (intro) or long (full) description. **Default Option**
- **Before Price:** Fields appear directly above the price block. Good for a short spec summary.
- **After Price:** Fields appear directly below the price block.
- **Before Add to Cart Button:** Fields appear immediately above the Cart button.
- **After Add to Cart Button:** Fields appear immediately below the Cart button.
- **Layout Slots:** Each ticked field appears only where a template layout asks for it by name, so every field can sit in its own spot. See [Layout Slots](https://docs.j2commerce.com/v6/apps-and-extensions/apps/contentfields#layout-slots).

### Description Slot

Visible only when **Display Method** is set to **End of Product Description**.

![Content Fields settings: Display Method End of Product Description with the Description Slot label and dropdown highlighted, set to Short Description (Intro)](https://docs.j2commerce.com/images/docs/shared/content-fields-description.webp)

- **Short Description (Intro):** Appends fields to the intro text shown in category and article views.
- **Long Description (Full Text):** Appends fields to the full article text shown only on the product detail page.

### Layout Slots

With **Display Method** set to **Layout Slots**, the plugin adds no fields by itself. A layout in your template asks for one field by its name, and the plugin prints that field at that spot. Only fields ticked for the current view in **Category View Fields** or **Product View Fields** are printed, and **Pages to Display** still applies.

Add this line to the layout where the field belongs. Replace `field_name` with the name of the custom field.

```php
echo J2CommerceHelper::plugin()->eventWithHtml('RenderContentField', [$product, $context, 'field_name']);
```

Product cards in modules, cross-sells and search results count as list views, so they use the category view fields.

#### Restyling the Field Output

To change the markup of a field, copy the plugin's `tmpl/field_display.php` to `templates/<your template>/html/plg_j2commerce_app_contentfields/field_display.php` and edit the copy. The copy is used instead of the plugin file.

### Pages to Display

Controls which pages show the fields.

- **Product View:** Detail page only.
- **Category View:** Product list / category page only.
- **Product & Category View:** Both pages.
- **None (Hidden):** Fields are never shown. Use this to temporarily hide all output without disabling the plugin.

### Category/Product View Fields

These fields will be empty until you create your custom Content Fields. (See examples below on how to create the fields) Once they have been created, go back to the app and select which Joomla article custom fields to display in the product detail view

![Content Fields plugin settings highlighted: Category View Fields empty, Product View Fields with Special Alert selected, Show Field Label Yes](https://docs.j2commerce.com/images/docs/shared/content-fields-config1.webp)

### Creating Content Fields Groups

Before the fields can be attached to a category and/or product, the custom content **Fields** and **Field Groups** need to be created. Field groups are useful when you want to show or hide a related set of fields together.

Go to **Content -> Field Group -> New**. Set the **Context** dropdown to **Articles or Category.**

![Joomla Category Field Groups list with Content, Field Groups, the New button and the Category context dropdown highlighted, showing one Category group](https://docs.j2commerce.com/images/docs/shared/content-fields-group-category2.webp)

Whatever you name your **Field Group** will appear as a new **tab** in the individual products or category level. For example purposes only, we have named the Field Group 'Category'; therefore, the tab is now named 'Category' when you open a category.

![Category edit screen for Chocolate Balls with the second Category tab highlighted, showing a Category SEO description field beside the Add to User Group and J2Commerce tabs](https://docs.j2commerce.com/images/docs/shared/content-fields-category.webp)

### Creating Content Fields

Joomla has a built-in Custom Fields system that lets you attach extra data to content items. You create a field once â€” for example, a text field called "Material" â€” and Joomla stores and displays its value alongside the article it is assigned to.

> **Tip:** The Title and Description that you create in 'Fields' will appear on the frontend once it's been assigned to a product or category

### Article Fields

![Joomla Articles Fields list with the Fields menu item, the New button and the Articles and Category context dropdown highlighted, listing a Special Alert text field](https://docs.j2commerce.com/images/docs/shared/content-fields-article.webp)

To create a custom field, go to **Content** -> **Fields** and click **New**. Set the **Context** dropdown to **Articles**. Fill in a label, choose a field type (Text, List, Textarea, etc.), and save. That field now appears in the article edit form under a **Fields** tab.

### Category Fields

![Joomla Category Fields list with Content, Fields, the New button and the context dropdown set to Category highlighted, listing a Category SEO text field](https://docs.j2commerce.com/images/docs/shared/content-fields-group-category0.webp)

Fields can be organized into groups using **Content** -> **Field**. Set the **Context** dropdown to **Category**. The shortcode mode described later in this guide supports both individual fields and field groups. A multi-select picker listing all your `com_content.article` custom fields. Only the fields you select here appear on category (product list) pages. Leave empty to show nothing in the category view even if **Pages to Display** includes category pages.

![Field edit form for Category SEO with Type Text, Name category-seo, Field Group Category, Category All, and the Description field highlighted](https://docs.j2commerce.com/images/docs/shared/content-fields-group-category1.webp)

The description section is if you want to explain what should be written on the frontend. The example below shows the description appearing in the Category and the category field group tab

![Category edit screen for Chocolate Balls with the second Category tab highlighted, showing a Category SEO description field beside the Add to User Group and J2Commerce tabs](https://docs.j2commerce.com/images/docs/shared/content-fields-category.webp)

### Customize the Fields to a Product

Open your **product** **->** click on your new custom content field **tab** (in the example below, we named the tab Product but you can name it whatever is appropriate for the field. Same picker, applied to the product detail page. You can select different fields for each view â€” for example, show only a brief "Material" field on the list page but add "Care Instructions" and "Dimensions" on the detail page.

![Article edit for Ring of Fire with the Product tab highlighted and the Special Alert field label highlighted, holding the value Burns like no other!](https://docs.j2commerce.com/images/docs/shared/content-fields-product.webp)

## Frontend Product View

![Ring of Fire product page with the custom field line Special Alert: Burns like no other! highlighted below the Add to Cart button](https://docs.j2commerce.com/images/docs/shared/content-fields-product-frontend.webp)

**Show Field Label:** Set to Yes to display each field's label followed by its value. Set to No to display only the field value.

### **Bootstrap 5 Accordion**

![Content Fields plugin settings highlighted: Bootstrap 5 Accordion Never, Accordion Threshold 10 characters, Debug Mode Never](https://docs.j2commerce.com/images/docs/shared/content-fields-config.webp)

**Bootstrap 5 Accordion:** Set to **Yes** to wrap each field value in a collapsible Bootstrap 5 accordion panel. The field label becomes the panel header.

**Accordion Threshold (characters):** Minimum character count that triggers the accordion wrapper. Field values shorter than this number are displayed inline (no accordion). Default: `10`.

Use the accordion when you have long field values â€” care instructions, ingredient lists, detailed specs â€” that would push the layout down. Short values like a one-word color name display inline regardless of the accordion setting.

### Debug Mode

Set to **Yes** to write detailed log entries to `administrator/logs/plg_j2commerce_app_contentfields.php`. Each log line shows how many fields were resolved for a given article ID. Turn this off in production â€” it writes on every product page load.

## Shortcode Mode Walkthrough

![Content Fields plugin settings with Display Method highlighted and set to Shortcode, and Pages to Display set to Product & Category View](https://docs.j2commerce.com/images/docs/shared/content-fields-shortcode.webp)

When **Display Method** is set to **Shortcode**, the plugin processes tokens inside your article text and replaces them with the rendered field HTML.

**Supported tokens:**

```


        Doc Source: 
v6/apps-and-extensions/apps/contentfields.md

    Related Products: 
Content Custom Fields

    Release Version: 
6.0.2

    Release Checked: 
2026-06-02
```

Replace `N` with the numeric ID of the field or field group you want to display. `Doc Source: v6/apps-and-extensions/apps/contentfields.md Related Products: Content Custom Fields Release Version: 6.0.2 Release Checked: 2026-06-02` renders all fields attached to the article.

**Finding the field ID:**

1. Go to **System** -> **Manage** -> **Fields**.
2. Click the field you want to use.
3. The ID appears in the browser URL: `...&id=7` means the field ID is `7`.

**Example:** To show field 7 inside an article description, place this token in the article text at the exact spot you want it to appear:

```
    Release Version: 
6.0.2
```

The plugin replaces the token with the rendered field output when the page loads. If the field has no value for that article, the token disappears silently.

The **Category View Fields** and **Product View Fields** selectors have no effect in shortcode mode â€” the tokens in the article text control which fields appear and where.

## Common Use Cases

### Specs Panel Under the Price

Set **Display Method** to **After Price**. Under **Product View Fields**, select the fields that hold your product specifications (dimensions, weight, material). Shoppers see these details right after the price, before deciding whether to add the product to the Cart.

### Hidden Detail Accordion for Long Descriptions

Set **Display Method** to **End of Product Description** and **Description Slot** to **Long Description (Full Text)**. Enable **Bootstrap 5 Accordion** and set **Accordion Threshold (characters)** to `50`. Care instructions or warranty text collapses by default and expands on demand, keeping the page clean.

### Mixed Inline Tokens in Long Descriptions

Set **Display Method** to **Shortcode**. In each article, place tokens directly in the body text where you want fields to appear â€” between paragraphs, inside a table, or after a heading. This gives you full control over placement on a per-product basis.

## Troubleshooting

### Fields Are Not Appearing on the Page

1. Confirm the plugin is enabled under **J2Commerce -> Apps -> Content Fields**.
2. Check **Pages to Display** â€” if it is set to **None (Hidden)**, no fields will appear.
3. Verify that at least one field is selected in **Category View Fields** or **Product View Fields**.
4. Open the article attached to the product and confirm the custom field has a saved value. Empty fields produce no output.
5. Confirm the custom field context is set to **Articles** (`com_content.article`). Fields created for other contexts (e.g., Contacts) are not visible to this plugin.

### Shortcode Token Appears in the Page Text

**Display Method** must be set to **Shortcode** for tokens to be processed. If it is set to any other option, tokens are left untouched in the article text.

### A Layout Slot Field Is Empty

Check that **Display Method** is set to **Layout Slots**, the field is ticked for this view, and the name in the layout line matches the custom field's name exactly.

### Debug Logs Location

When **Debug Mode** is enabled, logs are written to:

```
administrator/logs/plg_j2commerce_app_contentfields.php
```

Each entry shows the number of fields resolved per article ID and the current context. Check this file first when field output is unexpected.
