Page 1 of 1

Announcement Bar - how? Help!

Posted: Thu Oct 26, 2023 5:06 am
by CVFM
Hey all, this is probably really easy. I haven't used CMS Made Simple, I need to add an announcement bar and can't for the life of me see how to add this. Could someone please help me out? Thanks.

Re: Announcement Bar - how? Help!

Posted: Thu Oct 26, 2023 2:47 pm
by DIGI3
Specific instructions are going to be hard without knowing how your site is built, what version of cmsms you're using, and what your skill level with html/css/smarty/etc is. But generally the process would be adding the html to your main page template and styling it in your stylesheet. If you want the bar's content it to be editable by content editors, you could add a content block to the home page then use {page_attr ...} to retrieve and show the bar if the field is populated. There are also a number of modules that allow more elegant global content. One rough and basic method below, assumes you're using template inheritance.

Home page template:
{content block='announcement' label='Announcement Bar Content' assign='announcement'}

Master template:
{page_attr page='home' key='announcement' assign='announcement'}
{if $announcement}<div id="announcement">{$announcement}</div>{/if}

Style as needed. Editors can populate the announcement by editing the home page in Content Manager.