We have a number of clients who get confused when they use the Silverstripe CMS and then their live website displays the Draft version.
We've setup "Better Navigator" that displays whether a site is in Draft or Live but the clients still get confused (and in some view the Better Navigator button is obscured).
Ideally if the live website is being viewed outside of the CMS we want it to only display the "Live" version.
Is that possible?
Instead of forcing the site to always display the published version, we can add some draft only CSS to make it much more obvious to the user that they are viewing the draft version.
Create a draft.css file, which will alter the site styling on the draft version. In this example I am changing the background of the body tag to display a tiled image with the words "Draft" on it.
mysite/css/draft.css
body {
background-image: url(../images/draft-background.png);
}
mysite/images/draft-background.png
In our Page_Controller init function we load the draft.css file when the current stage is set to Stage:
Page_Controller
class Page_Controller extends ContentController
{
public function init()
{
parent::init();
// ...
if ($this->current_stage() == 'Stage') {
Requirements::css('mysite/css/draft.css');
}
}
// ...
}
The end result looks something like this:
This is just one of example of what we can do with the draft only css. Alternatively we could replace the site logo, or display a warning bar at the top of page content.
Here is some alternate css to display the above draft-background.png above all the site content instead of a background image of the body tag:
body:after {
background-image: url(../images/draft-background.png);
content: "";
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 1000;
pointer-events: none;
opacity: 0.25;
}
Here is some example css to display a warning bar at the top of each page:
body:after {
content: "You are currently viewing a draft version of this page";
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10000;
pointer-events: none;
opacity: 0.75;
text-align: center;
background: #F7CA18;
color: #000000;
padding: 20px;
}
body {
margin-top: 60px;
}
Related
So I wrote a CSS userstyle that moves the player controls for Youtube videos underneath the player.
#movie_player > div.ytp-chrome-bottom {
position: absolute;
bottom: 0px;
right: 0px;
z-index: -1;
opacity: 1 !important;
display:block
}
#movie_player > div.ytp-gradient-bottom {
display: none
}
#player-container-inner {
padding-bottom: 51px;
display:block
}
It works fine, the only issue is that the progress bar and time don't update if the video isn't being hovered over. Is there any way to force it to remain active/updating via CSS or a javascript userscript? This script is able to do so but I am having trouble parsing exactly what part of the script is doing that. https://greasyfork.org/en/scripts/11485-youtube-ui-fix
AppSumo requires that the "Discount code" field be renamed "AppSumo Code". Without accessing the FTP, can I do this in the "customize CSS" section of my Wordpress site?
I also have to change the "Apply" text to "Redeem AppSumo Code".
Please help!
enter image description herehttps://www.molo9.com/my-account/membership-checkout/?level=4
I have tried
label.pp-discount-code {
visibility: hidden !important;
}
label.discount-code {
visibility: hidden !important;
}
.pp-discount-code {
visibility: hidden !important;
}
to hide the discount code label so that I could use
.pp-discount-code:before {
content: ‘Enter your AppSumo Redemption Code below’;
visibility:visible;
}
but none of this is working. Please advise.
Add a class to particular label
In the CSS: make font size 0 to this label to hide existing text and create a before sudoku element from CSS, in the before add the content whatever you wanted to display in place of a hidden label
Example:
Name
CSS:
label.hidetext {
font-size: 0;
position: relative;
}
label.hidetext:before {
content: "Full Name here";
position: absolute;
top: 0;
left: 16px;
width: 100%;
height: 20px;
font-size: 20px;
}
I'm using oceanwp theme,
I want to have topbar that disappears when scrolling and the menu will jump to the topbar place (with opacity) i was trying this code
#site-header {
position: fixed;
left: auto;
width: 100%;
z-index: 2000;
opacity: 0.9;
}
and that not working,
the menu is stick in his place and there is a hole in the topbar place,
someone know how to fix it?
Can you send to us link to your site, this gonna make everything more easy. If, this 'sticky' menu is creating with jquery or vanilla js then your css fixes doesn't change anything. Just check your js files for ".scroll(" and you should find this snippet.
//Sorry for my english skills :/
window.onscroll = function() {myFunction()};
function myFunction() {
if (document.documentElement.scrollTop < 50) {
document.getElementById("site-header").style.top='auto';
} else{
document.getElementById("site-header").style.top=0;
}
}
I know it's not the best semantic solution, but its should work for your site. Add this to custom js, or another js file.
I checked on your site and its working :)
Just add this code to your custom CSS/js in the theme customizer section and vuala!
#site-header {position: stuck; left: auto;
width: 100% z-index: 2000;opacity: 0.9;
}
This one worked for me
#site-header {
position:fixed !important;
z-index:1000;
top:0;
width: 100%;
}
#main {
margin-top: 70px !important; /* 70px - width of the header. This can be changed from the theme customizer */
}
On this site in the search in the header I can't click the top two AJAX search results because I think they are under another layer. (Search for: condo). I have tried messing with the z-index. I changed the background color of the header to be able to see the top two search results. Here's what I put in the child CSS:
.fusion-sticky-header-wrapper {
display: block;
position: relative;
z-index: 2;
}
.fusion-header-v2 .fusion-header, .fusion-header-v3 .fusion-header,
.fusion-header-v4 .fusion-header, .fusion-header-v5 .fusion-header {
display: block;
background-color: rgba(255,255,255,0);
position: relative;
z-index: 1;
}
.search-in-place, .item {
z-index: 10000;
}
Same results with other plugins so I know it must be in the site CSS, right? Any help appreciated.
The header bar is over the search results because of this declaration:
.fusion-header-wrapper {
position: relative;
z-index: 10010;
}
To solve this you would need to remove the z-index declaration from the header wrapper or set the z-index for the search results higher than 10010, for example:
.search-in-place, .item {
z-index: 10020;
}
Hi I am trying to build a angular single page app for mobile that uses a map on one page. It also should include a sticky footer, and is based on bootstrap. The sticky footer css interferes with the css needed to get the map to take up all of the remaining screen space, so I add a class='map' to the html element to override certain css elements (see below).
Everything works nicely until I go to the map page, leave it and then return to the map page. In this instance the map is not working correctly at all. It is hard to describe, so please try the plnkr.
I have found CSS that works for the map reloading, but then that breaks something else in the site. It is driving me crazy trying to combine the two models, hence my appeal for help.
Update: I have now found that resizing the screen rectifies the rendering issues, until you leave and return to the map. Of course a mobile use cannot change their screen size, but this may help find a solution.
html {
position: relative;
min-height: 100%;
}
html.map {
height: 100%
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.map body {
/* For Google map */
height: 100%;
margin-bottom: 0;
padding-bottom: 60px;
padding-top: 60px
}
footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}
header {
width: 100%;
background-color: #ccc;
height: 60px;
top: 0;
}
.map header {
position: absolute;
}
UPDATE
I implemented a solution similar to yours, which I found in this blog article. Essentially, you have to trigger a resize event in order to have the map repainted correctly when it goes from hidden to visible.
But I put my code into a directive instead of a controller (doesn't bloat controller and decorates the element it affects), instead of adding a watcher it runs only after the directive/element is linked (more performant), and it doesn't require you to re-enter your coordinates in order to refresh:
.directive('autoRefresh', function($timeout){
return {
restrict: 'A',
link: function(scope, elem, attrs){
$timeout(function(){
var center = scope.map.getCenter();
google.maps.event.trigger(scope.map, "resize");
scope.map.setCenter(center);
});
}
}
})
Updated Plunker
OK, so what I was missing was to trigger the resize event. This now works perfectly in my plunker but not yet in my more complex actual code. Nearly there!
restosApp.controller('mapCtrl', function($scope) {
$scope.$watch('map', function() {
google.maps.event.trigger($scope.map, 'resize');
var ll = new google.maps.LatLng(52.374, 4.899);
$scope.map.setCenter(ll);
});
});