subscribe to RSS feeds

What's happening at OcularCMS®

« back to all blogs

Code Blocks

code blocksA code block can contain any kind of HTML, including text, images, JavaScript, iframes, flash objects, etc. Although you can easily edit the HTML of your pages by clicking the "click to EDIT HTML" button in editMode, sometimes it's easier to use a placeholder for a more complicated or repetitive block of code. For example, to embed a Facebook or Twitter widget, you are supplied a snippet of code which you then add to your site. Or perhaps you have one piece of content that displays in multiple places. Well now you can simply save the code as a code block, then insert something that looks like   into your page(s). It's much easier to maintain and doesn't clutter up your page in editMode.

Some websites have been using code blocks for some time. However, now you have access to edit existing blocks, as well as add new ones. To edit existing blocks, go to "manage sites" => "code blocks". You can add new blocks on that page, or you can in editMode by clicking the new code block icon (see inset). In the resulting popup, you can either add a new one, or select from existing ones to insert into your page.


Categories: changelog

Blog Articles


subscribe for product announcements