Skip Navigation

[Resolved] Add custom field value to View Loop item contener

This support ticket is created 2 years, 1 month ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by diyanK 2 years, 1 month ago.

Assisted by: Minesh.

Author
Posts
#2462929

Hi team,

I need a way to change the background of a table row in a specific View Loop.

Best case scenario is if I can set a class that has the value of the a specific custom field from the current post in the loop.

Worst case scenario is I have to come up with a jQuery solution to do that on the front-end.

Any help is appreciated.

Thanks!

#2463417

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

First of all, I would like to know are you using classic view or block view.

Can you please share the screenshot of your view, once I review that I would be able to guide you in the right direction.

In addition to that, I would like to have debug information that will help us to debug and investigate your issue:
- https://toolset.com/faq/provide-debug-information-faster-support/

#2463459
Screenshot 2022-09-23 at 10.19.42.png

Hi Minesh,

I'm using blocks, screenshot attached.

Note the last custom field that says PO Status – values from this field I'd like to use as classes.

PS. Please note how bad looks the view in a Table format when previewed in Gutenberg, and when there are more than the default amount of rows. I guess you need to address this issue separately as well. It's quite annoying. I planned to report it, but it never turned into a show stopper for me, but since now we're at it - it's worth mentioning the issue as well.

Thanks in advance!

#2463479

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

As you are using the block view - there is no way to adjust the table row class using the custom field value.

The workaround would be if you go with classic view there you will have more control on output as you can adjust the HTML code and assign the dynamic custom field values using row.

PS. Please note how bad looks the view in a Table format when previewed in Gutenberg, and when there are more than the default amount of rows. I guess you need to address this issue separately as well. It's quite annoying. I planned to report it, but it never turned into a show stopper for me, but since now we're at it - it's worth mentioning the issue as well.
==>
We know that and the GUI is not that so impressive for the table based view. We will try to improve that but in future and there is no ETA on it.

#2463481

OKay,

Classic view is fine, I can perfectly deal with that.

I stopped using the classic view in order to move faster to an all-blocks stack, and to be on the safe side in the future.

Do you have a plan on turning off support for the classic views? Is it safe to use for a project that is planned to last for another 5 years or so?

Thanks!

#2463559

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Do you have a plan on turning off support for the classic views? Is it safe to use for a project that is planned to last for another 5 years or so?
==>
We are not going to stop supporting classic views so you should use it without any concerns.

#2463643

Awesome!

My issue is resolved now. Thank you!