I am creating a CMSMS site and the user has asked that they have an optional "status" bar that can appear at the top of the page. If they don't need it, it would not be visible (display:none; by default) but if they have a warning to post, then can show it and they can be the ones to make it visible.
How could I implement something like that and still make it easy for the user to "toggle it" on/off the backend?
Thanks!
User Toggle Content Visibility [solved]
User Toggle Content Visibility [solved]
Last edited by jsherry on Tue Jan 01, 2013 10:16 pm, edited 1 time in total.
Re: User Toggle Content Visibility
Add an additional content block and assign it to a variable then do a conditional statement to see it the content exists.
Re: User Toggle Content Visibility
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: User Toggle Content Visibility
@Rolf - Not what I needed, but might be useful another time, so I'll keep it in mind. Thanks.
@applejack - It's needs to be global, so a content block wouldn't work as well since there are 4 templates. If global content blocks had the option to make 'active/inactive' or 'enable/disable' like a content page can, I bet that would have worked out.
Any other thoughts? No way to embed the content of one CMSMS page into another is there? Then I could make a new page that could be turned on/off and the templates could reference it.
Just to recap, the idea is being able to create a warning bar across the top of the site for emergencies.
Example 'Severe whether conditions slowing down response times'
If there was a problem, the client could post something and a red bar with the message would appear at the top of the site. When the problem was over, they would have control to turn it off.
@applejack - It's needs to be global, so a content block wouldn't work as well since there are 4 templates. If global content blocks had the option to make 'active/inactive' or 'enable/disable' like a content page can, I bet that would have worked out.
Any other thoughts? No way to embed the content of one CMSMS page into another is there? Then I could make a new page that could be turned on/off and the templates could reference it.
Just to recap, the idea is being able to create a warning bar across the top of the site for emergencies.
Example 'Severe whether conditions slowing down response times'
If there was a problem, the client could post something and a red bar with the message would appear at the top of the site. When the problem was over, they would have control to turn it off.
Re: User Toggle Content Visibility
Re: No way to embed the content of one CMSMS page into another is there?
Yes there is you can use CGISimpleSmarty module though from the example you stated I would perhaps use the News module.
Yes there is you can use CGISimpleSmarty module though from the example you stated I would perhaps use the News module.
Re: User Toggle Content Visibility
I agree. In some sites I use a news category for messages. I then use Smarty logic to check if there are news (in some cases I limit the display to one article) on that category and display a bar (or any other sort of widget) with the message.applejack wrote:Re: No way to embed the content of one CMSMS page into another is there?
Yes there is you can use CGISimpleSmarty module though from the example you stated I would perhaps use the News module.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: User Toggle Content Visibility
I would use a news category, and expiration dates.
i.e:
1. create a news category called 'urgent notices' ... note the id of this category
2. create news articles in this category
(use either expiration dates, and/or only ensure that one article in this category is published at a time).
3. Create a new news summary template called 'urgent notices'
in that use logic like (not exact, making this up in my head)
{if count($entries) > 0}
<div id="urgent_notice">
{* remainder of news summary template *}
</div>
{/if}
4. Modify your page template(s) (you may need to modify multiple page templates) to call {News category=<categoryid> limit=1 summarytemplate='urgent notices'}
---
Now... Your page templates will display 0 or 1 urgent notices
depending on how many are 'published' in that category and are valid to display based on expiration dates.
Your users can then create new news articles, and if they fill in reasonable expiration dates and start dates... everything should just work.
You can use a special CMSMS page for this, and the CGSimpleSmarty module to pull content from that page and insert it into any other, but then you have greater concerns RE making sure that the page is active, trapping errors if it is not, making sure that the user cannot navigate to that page himself, SEO issues, and also potential styling issues. And, those notices don't disappear automatically.
i.e:
1. create a news category called 'urgent notices' ... note the id of this category
2. create news articles in this category
(use either expiration dates, and/or only ensure that one article in this category is published at a time).
3. Create a new news summary template called 'urgent notices'
in that use logic like (not exact, making this up in my head)
{if count($entries) > 0}
<div id="urgent_notice">
{* remainder of news summary template *}
</div>
{/if}
4. Modify your page template(s) (you may need to modify multiple page templates) to call {News category=<categoryid> limit=1 summarytemplate='urgent notices'}
---
Now... Your page templates will display 0 or 1 urgent notices
depending on how many are 'published' in that category and are valid to display based on expiration dates.
Your users can then create new news articles, and if they fill in reasonable expiration dates and start dates... everything should just work.
You can use a special CMSMS page for this, and the CGSimpleSmarty module to pull content from that page and insert it into any other, but then you have greater concerns RE making sure that the page is active, trapping errors if it is not, making sure that the user cannot navigate to that page himself, SEO issues, and also potential styling issues. And, those notices don't disappear automatically.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: User Toggle Content Visibility
Thanks everyone. Great suggestions. I'll get started and see how it works out.
Happy New Year!
Happy New Year!
Re: User Toggle Content Visibility
Worked great! The info here, combined with some info in the documentation helped me create a solution.