How can I add a class in a display form code

Labels

This Discussion is public

Notifications

How can I add a class or styles in a display form shortcode?

For instance this one:

{display-frm-data id="16317" filter="limited" limit="1"]

If I want to add a max width on this one how can I do that?

Thanks!

 


Attachment:

Hi,

You can't do that in the shortcode. But I have 2 suggestions: 1. What happens if you open the "text" tab and include the shortcode in a DIV?

Second option: when you edit the view settings, the "listing page" (the section that holds the field codes) allows you to add HTML to construct a table. You could build your HTML table structure and use inline styling.

But then you would have set maximum width but your table would be too wide on a mobile device.  That can be solved by using classes that you define in the style.css of your theme.

Good luck!

Best regards,

TeoS

You can add whatever classes you'd like on the form's settings/customize HTML tab. You can add classes at the form level or on an individual field level.

Reply to this Discussion