{label:skills}: {field:skills}

I am trying to add a class to the field skills. Cant find any documentation on adding a class to this field. Im sure its a simple fix, anyone got the solution?



Via the Channel Entries form, you'll have to go by the docs, I thought you could add attributes however I was thinking of a freeform field({freeform:field:my field attr:class="testClass"}, not a SAEF/Channel Entries field unfortunatly.

The examples show you how to make your form, with complete markup autonomously here : https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_form/examples.html#entry-form-without-using-the-custom-fields-loop.

Assuming its a basic text field :

    <label for="my_field_name">{label:skills}</label>
    <input type="text" class="testClass" name="my_field_name" id="my_field_name" value="{skills}">

If you look through the examples, the label:field syntax can be useful for the complex types like grid or relationship (see here also : https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_form/#including-assets) but it sounds like you'd be better suited by leveraging your power HTML skillz.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.