Projects: Fundraising Features Toggle

PHOTO EMBED

Wed Apr 27 2022 10:54:56 GMT+0000 (UTC)

Saved by @brandonbabb #html #javascript #ss

<!-- Remove Fundrasing Features OFF from SS -->
<script type="text/javascript">
    // <![CDATA[
    var collection = document.getElementsByClassName("tpl-main-content-side");
    collection[0].style.display = "none";
    // ]]>
</script>


<!-- Toggle Fundrasing Thermometer ON from SS -->
<!-- Paste this code into the WYSIWYG HTML area for a project -->
<script type="text/javascript">
    // <![CDATA[
    var container = document.getElementsByClassName("tpl-main-content-side");
    var button = document.getElementsByClassName("tpl-start-a-campaign");
    container[0].style.display = "block";
    button[0].style.display = "none";
    // ]]>
</script>
content_copyCOPY

Paste either the code to enable features OR the code to disable features (not both) into the source code area for a project using the WYSIWYG editor. What the code does is search the DOM for the first element instance node with the class string(s). It then applies a new inline style to that element which overrides the visibility set in the CSS. Which then makes it visible or invisible, it also reflows the content to either show the side content or allow the main content to take up the full column.