- ivnish Poland
@Berdir, @BramDriesen I want to discuss this feature. I have a client which is using Poll module to create photo competitions :)
He adds some code to choices:
<div class="photoswipe-gallery"> <a href="/sites/default/files/2023/10/27/pexels-craig-adderley-1563356_0.jpg" class="photoswipe" data-size="1024x682"><img src="/sites/default/files/styles/thumbnail/public/2023/10/27/pexels-craig-adderley-1563356_0.jpg" loading="lazy" width="100" height="60"> </a> <a href="/sites/default/files/2023/10/27/pexels-isabella-mendes-341013_0.jpg" class="photoswipe" data-size="1024x678"><img src="/sites/default/files/styles/thumbnail/public/2023/10/27/pexels-isabella-mendes-341013_0.jpg" loading="lazy" width="100" height="60"> </a> </div>
Now we can add HTML to choices, but only 255 symbols.
I changed choice field from
$fields['choice'] = BaseFieldDefinition::create('string')
to
$fields['choice'] = BaseFieldDefinition::create('string_long')
And PollChoiceDefaultWidget from
'#type' => 'textfield',
to
'#type' => 'textarea', '#rows' => 1,
It looks like
Of course we need to update existing field definition.
Is there any chance to add feature to mainstream if I make a patch?
- Issue was unassigned.
- π§πͺBelgium BramDriesen Belgium π§πͺ
I've been thinking about this for a bit and I think we first need to check #3042995: Convert votes into entities β . It would also be nice to put CKEDITOR 5 on the poll question field so we could also allow for some markup like bold or italic text. I think I've seen another issue about this but can't find it at the moment.