[Skip to main content](#vessel-content)

#   How to create several blocks of custom fields

##

- **[Rusty](/forum/user/83085-rusty "View Rusty's Profile")**
- [![Rusty's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/83085-rusty "View Rusty's Profile") Topic Author
- [ Offline](/forum/user/83085-rusty)

Less More

- Posts: 105
- Thank you received: 8
-

1 year 6 months ago -  1 year 6 months ago [\#366666](#366666) by [Rusty](/forum/user/83085-rusty "View Rusty's Profile")  *[How to create several blocks of custom fields](/forum/26-product-category-display/909336-how-to-create-several-blocks-of-custom-fields#366666 "-- HikaShop version -- : 5.1.5 -- Joomla version -- : 5.2.6 -- PHP version -- : 8.4.5  I have some questions about custom fields for the product page.  1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.  The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?  2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.  3. Or - would it be possible to create a &quot;characteristics&quot; table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).  4. How to display specific custom fields at a specific place? In my case, I created a field &quot;bottle deposit&quot;. This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?  Btw. the &quot;view builder&quot; does not help because even there are no way to move several blocks of custom fields to different locations.")* was created by *[Rusty](/forum/user/83085-rusty "View Rusty's Profile")*

-- HikaShop version -- : 5.1.5
-- Joomla version -- : 5.2.6
-- PHP version -- : 8.4.5

I have some questions about custom fields for the product page.

1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.

The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?

2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.

3. Or - would it be possible to create a "characteristics" table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).

4. How to display specific custom fields at a specific place? In my case, I created a field "bottle deposit". This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?

Btw. the "view builder" does not help because even there are no way to move several blocks of custom fields to different locations.

Last edit: 1 year 6 months ago by [Rusty](/forum/user/83085-rusty "View Rusty's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDkzMzYtaG93LXRvLWNyZWF0ZS1zZXZlcmFsLWJsb2Nrcy1vZi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14286
-
-

1 year 6 months ago -  1 year 6 months ago [\#366667](#366667) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to create several blocks of custom fields](/forum/26-product-category-display/909336-how-to-create-several-blocks-of-custom-fields#366667 "-- HikaShop version -- : 5.1.5 -- Joomla version -- : 5.2.6 -- PHP version -- : 8.4.5  I have some questions about custom fields for the product page.  1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.  The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?  2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.  3. Or - would it be possible to create a &quot;characteristics&quot; table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).  4. How to display specific custom fields at a specific place? In my case, I created a field &quot;bottle deposit&quot;. This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?  Btw. the &quot;view builder&quot; does not help because even there are no way to move several blocks of custom fields to different locations.")*

Hi,

1. One easy way to go about it is to create custom fields of the type "custom text" as group separators.

2. Using Joomla custom fields is not possible. First, it's really hard to integrate. And even if that was possible to integrate them, it wouldn't help you display static information. You're much better with using custom fields of the type "custom text", they are made for this purpose.

3. Characteristics won't help. It will be better to use custom product fields. They are made for this.

4. If you want to display a field somewhere else than the normal area of the product details page, you'll have to add custom code where you want the field to appear.
The code is quite simple: Code:

&lt;?php echo $this-&gt;element-&gt;XXX;?&gt;

where XXX is to be replaced by the column name of the field. Then, you can display the display setting of the field so that it doesn't also appear in the fields area where all the other fields appear.

Last edit: 1 year 6 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

The following user(s) said Thank You: [Rusty](/forum/user/83085-rusty "View Rusty's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDkzMzYtaG93LXRvLWNyZWF0ZS1zZXZlcmFsLWJsb2Nrcy1vZi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Rusty](/forum/user/83085-rusty "View Rusty's Profile")**
- [![Rusty's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/83085-rusty "View Rusty's Profile") Topic Author
- [ Offline](/forum/user/83085-rusty)

Less More

- Posts: 105
- Thank you received: 8
-

1 year 6 months ago -  1 year 6 months ago [\#366680](#366680) by [Rusty](/forum/user/83085-rusty "View Rusty's Profile")  Replied by *[Rusty](/forum/user/83085-rusty "View Rusty's Profile")* on topic *[How to create several blocks of custom fields](/forum/26-product-category-display/909336-how-to-create-several-blocks-of-custom-fields#366680 "-- HikaShop version -- : 5.1.5 -- Joomla version -- : 5.2.6 -- PHP version -- : 8.4.5  I have some questions about custom fields for the product page.  1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.  The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?  2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.  3. Or - would it be possible to create a &quot;characteristics&quot; table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).  4. How to display specific custom fields at a specific place? In my case, I created a field &quot;bottle deposit&quot;. This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?  Btw. the &quot;view builder&quot; does not help because even there are no way to move several blocks of custom fields to different locations.")*

> nicolas wrote: 4. If you want to display a field somewhere else than the normal area of the product details page, you'll have to add custom code where you want the field to appear.
> The code is quite simple:
> &lt;?php echo $this-&gt;element-&gt;XXX;?&gt;
> where XXX is to be replaced by the column name of the field. Then, you can display the display setting of the field so that it doesn't also appear in the fields area where all the other fields appear.

Thank you! This helps a lot! ![:cheer:](/media/kunena/emoticons/2.png ":cheer:")

Last edit: 1 year 6 months ago by [Rusty](/forum/user/83085-rusty "View Rusty's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDkzMzYtaG93LXRvLWNyZWF0ZS1zZXZlcmFsLWJsb2Nrcy1vZi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Rusty](/forum/user/83085-rusty "View Rusty's Profile")**
- [![Rusty's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/83085-rusty "View Rusty's Profile") Topic Author
- [ Offline](/forum/user/83085-rusty)

Less More

- Posts: 105
- Thank you received: 8
-

1 year 6 months ago [\#366792](#366792) by [Rusty](/forum/user/83085-rusty "View Rusty's Profile")  Replied by *[Rusty](/forum/user/83085-rusty "View Rusty's Profile")* on topic *[How to create several blocks of custom fields](/forum/26-product-category-display/909336-how-to-create-several-blocks-of-custom-fields#366792 "-- HikaShop version -- : 5.1.5 -- Joomla version -- : 5.2.6 -- PHP version -- : 8.4.5  I have some questions about custom fields for the product page.  1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.  The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?  2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.  3. Or - would it be possible to create a &quot;characteristics&quot; table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).  4. How to display specific custom fields at a specific place? In my case, I created a field &quot;bottle deposit&quot;. This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?  Btw. the &quot;view builder&quot; does not help because even there are no way to move several blocks of custom fields to different locations.")*

Hi @nicolas,

for the reason (discussed before) I created a new section in product / show_block_dimensions ... like this:
Code:

&lt;!-- PFAND --&gt; &lt;span id="pfand"&gt;zzgl. Pfand: &lt;?php echo $this-&gt;element-&gt;pfand ?&gt; &amp;#x20AC;&lt;br/&gt;&lt;/span&gt; &lt;!-- EO PFAND --&gt;

This works but has a problem: If the value (pfand) is empty, the text (zzgl. Pfand) is still displayed. Which is technically correct, I know! But I want to display the whole line only if it contains a value. So I tried the following:
Code:

&lt;!-- PFAND --&gt; &lt;?php if(!empty($this-&gt;element-&gt;pfand) { ?&gt; &lt;span id="pfand"&gt;zzgl. Pfand: &lt;?php echo $this-&gt;element-&gt;pfand ?&gt; &amp;#x20AC;&lt;br/&gt;&lt;/span&gt; &lt;?php } ?&gt; &lt;!-- EO PFAND --&gt;

But it doesn't work. I get the error:

> ERROR 0 - syntax error, unexpected token "{" in /path\_to\_website/templates/astroid\_template\_two\_ghc/html/com\_hikashop/product/show\_block\_dimensions.php:44

This is line 44:
Code:

if(!empty($this-&gt;element-&gt;pfand) { ?&gt;

What did I wrong?

Cheers
Rusty

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDkzMzYtaG93LXRvLWNyZWF0ZS1zZXZlcmFsLWJsb2Nrcy1vZi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86324
- Thank you received: 14286
-
-

1 year 6 months ago [\#366793](#366793) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to create several blocks of custom fields](/forum/26-product-category-display/909336-how-to-create-several-blocks-of-custom-fields#366793 "-- HikaShop version -- : 5.1.5 -- Joomla version -- : 5.2.6 -- PHP version -- : 8.4.5  I have some questions about custom fields for the product page.  1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.  The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?  2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.  3. Or - would it be possible to create a &quot;characteristics&quot; table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).  4. How to display specific custom fields at a specific place? In my case, I created a field &quot;bottle deposit&quot;. This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?  Btw. the &quot;view builder&quot; does not help because even there are no way to move several blocks of custom fields to different locations.")*

Hi,

You're almost there.
A big rule of programming (and calculus in general) is that when you open something, you need to close it.
On this line, you have 2 open parenthesis but only 1 closing parenthesis.
That's why PHP gives you the error "unexpected token "{" ". It expects a closing parenthesis before the { and doesn't find it.
Add a second one right after the first one and it will work.

The following user(s) said Thank You: [Rusty](/forum/user/83085-rusty "View Rusty's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDkzMzYtaG93LXRvLWNyZWF0ZS1zZXZlcmFsLWJsb2Nrcy1vZi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

- **[Rusty](/forum/user/83085-rusty "View Rusty's Profile")**
- [![Rusty's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/83085-rusty "View Rusty's Profile") Topic Author
- [ Offline](/forum/user/83085-rusty)

Less More

- Posts: 105
- Thank you received: 8
-

1 year 6 months ago [\#366795](#366795) by [Rusty](/forum/user/83085-rusty "View Rusty's Profile")  Replied by *[Rusty](/forum/user/83085-rusty "View Rusty's Profile")* on topic *[How to create several blocks of custom fields](/forum/26-product-category-display/909336-how-to-create-several-blocks-of-custom-fields#366795 "-- HikaShop version -- : 5.1.5 -- Joomla version -- : 5.2.6 -- PHP version -- : 8.4.5  I have some questions about custom fields for the product page.  1. is there a way to create multiple blocks or sections with custom fields? Let's say I want to create three sections. Each section should contain four to five text fields (read only). These sections should be displayed as ‘separate’ sections so that the customer can read them in a structured way. I'm talking about sections like ‘Technical Data’, ‘Ingredients’ and so on.  The big problem is that all custom product fields are listed as a long list one after the other - regardless of what kind of content I want to display. How can I create individual sections?  2. is there a way to use the Joomla core custom fields to display some information? That would make it massively easier. I'm only talking about text information here, i.e. nothing would need to be calculated with these types of custom fields.  3. Or - would it be possible to create a &quot;characteristics&quot; table - where I could note some technical information? I do not want to create variants but have the customer to inform about several product data (in a structured way).  4. How to display specific custom fields at a specific place? In my case, I created a field &quot;bottle deposit&quot;. This field must be displayed right after the price. But in all display types of the product page (standard, table, reversed) all custom fields are in one html structure, like ul or table. I can not exclude one specific custom field value to display it on a specific location inside the product page. Or did I oversee something to achive this?  Btw. the &quot;view builder&quot; does not help because even there are no way to move several blocks of custom fields to different locations.")*

> nicolas wrote: You're almost there.

I knew it! ![:-D](/bigsmile.gif ":-D")
Thank you!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS85MDkzMzYtaG93LXRvLWNyZWF0ZS1zZXZlcmFsLWJsb2Nrcy1vZi1jdXN0b20tZmllbGRzP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.067 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
