I'm a die hard fan of aspx views over razor (cshtml) views. Is it possible to use aspx views in a Orchard theme?
For the moment yes, but there is talk about cutting that support by default. I'd be curious to know what you find so appealing about aspx.
Related
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.
I've been developing an static website (just html, css and js files) for a client who now wants to load the site on to Kentico CMS.
I don't know anything about this CMS. Is this a practical way to import the completed code into this system?
Thanks.
I would do things the way Kentico expects.
Take your header/footer and put them into the master page (template).
Take individual template HTML and create Layouts and Templates from them.
Use Kentico Web Part where possible
For dynamic content areas, use the Editable Content Web Part.
For the menu use the CSS Menu Web Part.
Use the Portal Engine technique. Don't use ASPX pages unless you really have to.
Here is some documentation from version 8: https://docs.kentico.com/display/K8/Creating+portal+engine+master+pages.
I have HTML/CSS complete - conventional stuff.
I now need a CMS for this site. To use Orchard for this do I need to create a Custom Theme? (eg as in this article
http://www.deepcode.co.uk/2011/05/real-world-orchard-cms-part-2-creating.html
Or are custom themes for people that want to make something re-usable?
If there is an easier way to put Orchard CMS in a totally custom design - what is it?
Thx
You definitely need to create your own theme. You could start with an existing theme and modify it, but if you've already got a static HTML/CSS design then you're probably best off starting from scratch.
For more information on theming you can check out:
Writing a new theme - Orchard Documentation
Theming Orchard - A blog post I wrote a while ago
Studying the code of some existing themes can be a nice way to see how a theme is made up.
You should not directly modify the base template files inside Orchard modules. These are made to be overridden in your theme and modifying them directly will make updating Orchard very tricky.
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.
If I create multiple portlets with liferay, how can I have 1 theme control the look of all of them?
Thanks
The Liferay's templating system consists of Velocity/Freemarker templates that renders particular html segments of portlets on a page. It is essentially one theme that styles everything.
If you choose to use JSPs on server side and Alloy UI framework on client side, even your portlet would have the same look and feel as the rest of the portal because Liferay JSP taglibs and Alloy UI both use the same CSS classes that the classic/default Liferay theme is expecting and made for.