I'm looking into DevDemon's Channel Polls and EE Harbor's Polls module... What my client really wants is the option to have WYSIWYG HTML content for each poll OPTION (i.e. not just the poll question).

I can get close by creating a Matrix/Wygwam field to list the content for each option, and then put the voting/selection form after that. But, what my client really wants is for the voting controls to be in-line with the HTML content for each option.

So, my questions are:

  • Is there a clever way to get the voting controls inline with content defined in another custom field?
  • Or, if not, do these polls modules allow for HTML content to be entered in the plain-text options fields?

If the option fields are textareas, you should be able to easily add Redactor to the fields you want to change to WYSIWYG.

Below are installation instructions from the Redactor docs:

You can use the CP CSS & JS extension to add the JS/CSS to the header.

You'll need to inspect the html of the edit form to determine the selectors for the fields you want to convert. Add those into your JS and you should be set.

If you are already using DevDemon's Editor addon, you can reuse his js/css file includes instead of adding these new ones to the header.

To install Redactor, place the following code between the tags:

<link rel="stylesheet" href="/js/redactor/redactor.css" />
<script src="/js/redactor/redactor.js"></script>

If your Redactor download is placed in a different folder, don't forget to change file's paths.

You can call Redactor using the following code:

<script type="text/javascript">

This code may also be placed between the tags or at any other place on the page.

Finally, you need to place a element with ID "redactor_content" (or with the ID that you set during Redactor's call). This element will be replaced by the visual representation of the Redactor.

<textarea id="redactor_content" name="content"></textarea>

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.