Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Sonya* Posted September 7, 2019 Posted September 7, 2019 Hi, in my theme I have customized the background color of the website, so that it is different from the default. When I add an WYISWYG widget (Pages) to the website, the widget misses the CSS class ipsBox. It means that there is literally no box (borders or background) like in other widgets. How can I add a class to the widget, so that it is displayed the same way as other widgets/boxes? How it looks like now: How I would like to have it: Thank you!
bfarber Posted September 9, 2019 Posted September 9, 2019 You'd have to edit as HTML (either from the AdminCP, or by using an account that can post HTML), and then manually wrap the HTML contents of the WYSIWYG block <div class='ipsBox'> whatever you already have </div>
Sonya* Posted September 10, 2019 Author Posted September 10, 2019 @bfarber, this breaks layout a bit. As the box has not the same width as the other boxes on the site. It is slightly smaller as the class is inlined. I have found another "simple solution". I have edited the template cms->front->widgets->Wysiwyg and added ipsBox to the widget itself: <div class='ipsWidget_inner ipsPad ipsBox ipsType_richText' data-controller='core.front.core.lightboxedImages'> {$content|raw} </div> It looks the same way now as other boxes.
Daniel F Posted September 10, 2019 Posted September 10, 2019 Have you tried to use div class='ipsWidget_inner ipsPad ipsBox ipsType_richText' data-controller='core.front.core.lightboxedImages'> content </div> Instead of Quote <div class='ipsBox'> whatever you already have </div> ? There shouldn't be a need to edit the widget template
Sonya* Posted September 10, 2019 Author Posted September 10, 2019 I have edited the template by adding ipsBox along with ipsWidget. It looks good now. No need to edit HTML while creating a WYISWYG block and the block itself has the same width and style as other boxes. By adding HTML into widget content I have slightly different width of the box as ipsWidget has padding.
kmk Posted September 25, 2019 Posted September 25, 2019 On 9/10/2019 at 2:22 AM, Daniel F said: Have you tried to use div class='ipsWidget_inner ipsPad ipsBox ipsType_richText' data-controller='core.front.core.lightboxedImages'> content </div> Instead of ? There shouldn't be a need to edit the widget template This work fine???
Sonya* Posted September 26, 2019 Author Posted September 26, 2019 11 hours ago, kmk said: This work fine??? I have not tried this as my moderators do not have any HTML knowledge and in this case they need someone who would add it for them. Additionally they tend to break HTML while editing the widget, as they do not use HTML view for it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.