项目作者: DanZenti

项目描述 :
A very basic notice bar for a website using Contensis content types and entries.
高级语言: C#
项目地址: git://github.com/DanZenti/contensis-noticebar.git
创建时间: 2018-07-26T13:53:12Z
项目社区:https://github.com/DanZenti/contensis-noticebar

开源协议:

下载


contensis-noticebar

A very basic notice bar for a website using Contensis content types and entries.

alt text

Instructions

  1. Copy the code from the noticebar.cshtml file to a razorview in your Contensis project.
  2. Create a new content type called ‘notice’
  3. Add the fields as shown in the screenshot below:
  • Title (text field)
  • Notice Markup (a markup field)
  • Notice Type (list field so you can add a comma separated list of notice types such as Default,Important,Event)
  • Notice Is Active (boolean)

alt text

alt text

CSS / SASS

You’ll need your own css :)

Or something like the following (SCSS):

  1. .notice {
  2. position:sticky;
  3. top:0;
  4. z-index:250;
  5. background:$bg-primary;
  6. color:$color-light;
  7. padding:8px 20px;
  8. text-align: center;
  9. // box-shadow: 0px 5px 20px $color-dark;
  10. p{
  11. margin:0;
  12. padding:0;
  13. }
  14. a {
  15. color:$color-light;
  16. border-bottom:1px solid rgba(255,255,255,0.2);
  17. }
  18. }
  19. // Colour options that can be set in entries
  20. .notice--rocket {
  21. background:#35424d;
  22. color:$color-light;
  23. }
  24. .notice--important {
  25. background:red;
  26. color:$color-light;
  27. }
  28. // CSS only close button
  29. .close {
  30. position: absolute;
  31. right: 10px;
  32. top: 10px;
  33. width: 22px;
  34. height: 22px;
  35. opacity: 0.3;
  36. border-bottom:0 none !important;
  37. }
  38. .close:hover {
  39. opacity: 1;
  40. }
  41. .close:before, .close:after {
  42. position: absolute;
  43. left: 10px;
  44. content: ' ';
  45. height: 23px;
  46. width: 2px;
  47. background-color: #fff;
  48. }
  49. .close:before {
  50. transform: rotate(45deg);
  51. }
  52. .close:after {
  53. transform: rotate(-45deg);
  54. }