Adding an external style sheet to Page Template Header Kentico CMS 7 - kentico

I have a hopefully simple question, but I have been trying to figure this out for the past few hours with no luck and no response from Kentico's support team.
Just recently upgraded Kentico CMS from 6 to 7 and am now having problems getting css to load that used to be just called in the individual page templates. I decided to try and add in the css link at the Site Manager > Development > Page Templates > My Template > Header tab. This is apparently supposed to work according to posts on Kentico's website, but no matter what I do, I cannot get the css file to load for that template.
The link tag for the css should be formatted correctly, but in case Kentico does something crazy, here it is
<link type="text/css" rel="Stylesheet" href="../_SalesPad/Stylesheets/_HomeMini.css" />
Any help would be greatly appreciated!

This seems to be working for me if I add your tag.
Could you make sure that in your masterpage on the header tab that "Allow child templates to inherit the current header" is ticked.

Related

LIFERAY 7.2 GA1 Theme: My custom scss style impacts the default Liferay Menu ( in the left hand side and in the top )

I have a problem when developing a new Liferay 7.2 theme based on gradle as a build tool, the problem is when I added a custom css in the file _custom.scss in order to customize some styles within my theme, the default liferay admin Control panel and Menu( in the left hand side and in the top ) are looking very bad and my theme looks not Responsive(I mean the style and there are buttons which are not displayed anymore example the toast-animation-btn is not visible ).
From my perspective, maybe my custom css ( because I have a large css file it is kind of Migration from 6.2 --> 7.2) is impacting the default liferay portal things --> this is just my opinion and maybe I could be wrong...
Otherwise, if my reasoning is true please How could prevent my styles to impact liferay default menu?
A whole lot of things have changed between 6.2 and 7.x html markup. I would strongly advise testing each small css feature independently and rewrite the one that is not compatible anymore. By feature I mean all css code related to a specific portlet or section of your template.
Also the theme template themselves have changed a lot and are not strictly compatible. In this case I'd suggest starting with a new theme templates and bring back one by one the customization, you made in it. Also look at the new content page feature: https://portal.liferay.dev/docs/7-2/user/-/knowledge_base/u/creating-content-pages You might be able to replace many theme customization with them in a more maintainable and web admin-friendly way.
That being said if you just want to isolate you sass code from impacting the admin menu, in the default template there is no quick way to identify the content section of the page (well, there is #wrapper and #content, but they are too generic and present in the admin page as well) I'd suggest that you add an id at the right level of your own template. After that just embed all your sass code inside that id.

Blazor .NET Core 3.0 - Can cshtml pages use MainLayout.razor

With previous versions of Blazor all files were cshtml pages and were able to use _layout similar to MVC projects - all was well.
But now in the new .NET Core 3.0 release Blazor template switched to *.razor files which are razor components (not razor pages). And the layout is now Shared/MainLayout.razor and is applied via routing in App.razor file:
<RouteView RouteData="#routeData" DefaultLayout="#typeof(MainLayout)" />
So this creates confusion. We're still able to add razor pages (.cshtml files) to the project but they do not get the layout applied. It would be a pain to create and maintain 2 separate identical layouts, 1 for razor pages and 1 for razor components. I was unable to find any guidance for this.
Is there any way to apply razor component layout (Shared/MainLayout.razor) to razor pages (.cshtml files) inside the same project? Of if not, what is the recommended approach?
The quick answer is no. Currently you can load Razor Components into a Razor Page but can’t load a Razor Page in a Razor Component. This is stated in the official docs.
I’m not sure there is a recommended approach as such - Except to try and refactor to Razor Components as much as possible, if using components everywhere is your goal.
If you want to keep a mix then I would suggest sticking with Razor Pages as pages (hope that makes sense) and only use components within those pages. That way you would only need the one Layout type.
in the head of your _Layout page add
<base href="~/" />
in the bottom of body add
<script src="_framework/blazor.server.js"></script>
then in your
_Host.cshtml
file add
#{
Layout = "_Layout"; //your Layout name
}
for more information follow this link
I currently have the same problem and it's really annoying. Would also be interested in a solution for this. I can't even load the layout with
#{
Layout = "shared/MainLayout.razor";
}
because it expects a file with the name MainLayout.razor.cshtml then.

Bootstrap in sharepoint web part

Does anyone know of a good way to use Bootstrap styles for a SharePoint web part? I don't want to restyle the entire SharePoint site with bootstrap styles. I just want to be able to use bootstrap elements like buttons and forms and modals within a SharePoint web part without interfering with the regular SharePoint styles on the rest of the site. So with that in mind looking at the example below should give a good picture of what I want. Basically I want to reset the styles and then apply bootstrap styling within the div with ID BootstrapContent but everything outside of that div should be unaffected and just use the normal SharePoint styles. Thanks for the help.
<html>
<body>
STANDARD SHAREPOINT STYLES
<div id='BootstrapContent'>
HTML CONTENT WITH BOOTSTRAP STYLES
</div>
STANDARD SHAREPOINT STYLES
</body>
</html>
There's no good way to isolate one part of your html without using iFrames. If you went that way you could put your html into a doc lib, then call it from an iframe. That html file would reference bootstrap and only affect the iframe. You can use the Page Viewer web part to create the iframe for you.
Another option which isn't quite what you are asking, is you could get a cut down (customized) version of bootstrap customized. If you only need the grid system for example, only get that option. You might be able to exclude a lot of the generic things that interfere with SP. However, you'd likely lose things you want.

CSS to Liferay theme

I have a css web design and I want to converted in Liferay theme. Is this possible?
I am using Liferay 6.1 Ga2 with Tomcat 7 and Liferay SDK for java.
Any advice will be appreciated!
Thanks in advance
If you have css designs then you can use it in your theme. But make sure that if you are using any liferay OOB portlets then you have to customize those OOB portlets CSS as well.
afaik,Direct conversion of css designs into liferay css structure is not possible.
From someone who has a background as a Web Designer who learned Liferay. You need to extend the basic theme and start customizing it. You do this by creating a theme through the liferay SDK. Then it copies all the files into /docroot/diffs/*
In there you will see a css folder, in there you will see a custom.css file, That is the file you want to add your css properties to. It has highest/last priority to set elements and attributes.
If you want to customize the template engine, you need to look at the velocity templates under /docroot/diffs/templates. If you're new to it, make a copy of the file you're playing with so you don't have to blow it all away and start over if you mess up. But basically Velocity is very easy to learn. If you want to embed images directly in velocity from liferay via your theme via the /docroot/diffs/images/custom/ folder, here is a piece of code that will work.
<img src="$themeDisplay.getPathThemeImages()/custom/image_name.png" id="logo" />
I recommend though to keep the portal_normal.vm as similar to the default portal_normal.vm because then upgrading will be easier down the road.

Help on DotNetNuke

Does any body know how can i change the layout of a dotnetnuke website. I need to modify the standard layout
You can use a custom skin or modify the default skin that comes with the DNN installation. The default skin files are in [Website]\Portals_default\Skins\MinimalExtropy\ where [Website] is your DNN web site folder. If you are new to skinning and have a lot of questions, I am sure that the DNN forums will be helpful - DNN Skinning forums
You can do that by editing the CSS. I had similar issue, for which I used " inspect element" in google chrome that helped me in recognizing div elements and css properties. You can find css in portals_default\Skins\DarkKnight (or your own skin name) \skin.css
If your wanting to do anything outside of the CSS (ie, turn off the search bar on a page); then you have to have full access to the site -- open the site via FTP or download all the files, then you can modify the 'default' page, or the skin file you want to change. my suggestion is to make a 'copy' of the skin default page you want to change, give it a new name, and then save it back to the server. When you go to change the 'skin' theme from the 'site manager' you will see your new skin page listed as an option. Modifying from the CMS does not allow you to modify the actual 'page', only its 'parts'. There is also a starter kit available for Visual Studio, google "DNN Starter Kit" which you can create custom modules, skins and containers.

Resources