KOHANA Themes - how to set theme in K3 - kohana-3

dudes.
I hope this question is not a repost.
I'm newbie on Kohana. I'm working in a system made by other guy.
I need to understand how to set the theme but I can't find anything here nor google.
I found that in some systems is set a cookie called theme. But I don't know where to set this cookie.
Could someone tell how to set themes in Kohana?
Thank you all, dudes.
JuanMatias

Kohana is a framework to develop applications from scratch - it doesn't come with any themes like Drupal or WordPress. If what you are looking for are templates, you can use the Controller_Template base class. Just make your controllers extend it:
class Controller_Extends extends Controller_Template
Then set the template body using something like:
$this->template->content = $content;
Finally, create the template file in application/views/template.php:
<!-- Here goes the header -->
if (isset($content)) echo "<div id='content'>$content</div>";
<!-- Here goes the footer -->

Related

Custom page template not showing up when using a pagebuilder theme (mostly Elementor)

I've installed a theme (that i bought) that's mainly made with Elementor.
Since I've been running into some issues with customizing this theme, (and still refuse to also pay money for Elementor Pro) I decided it would be easier to create a custom template myself.
I have done this before when I used a custom theme I made myself from scratch (I thought I was saving myself some time this time around...).
So my problem: I saved this template called page-home.php to my Child theme (that I made of the purchased Theme) in a folder called page templates.
It is not showing in the drop down menu when creating a new page.
I then just copied it to the main theme, activated that...and still not showing.
Is this because the Theme is using a page builder like Elementor?
Or do you think the creator of the theme somehow disabled this option?
Thanks in advance for any help.
As far as I know Elementor ignores the most of the standard theme file. It does so i.e. with the header.php for sure. The question is what do you want to put in a theme file what you couldn't do with Elementor. Have a look at the
"Hello Theme" https://github.com/elementor/elementor/issues/14283 - it's a plain theme.
If you don't want to pay for Pro, I recommand the plugin "Elementor – Header, Footer & Blocks Template" (and for better editor handling: "Flexible Elementor Panel")

Footer in Liferay

I need to make a footer in Liferay and use theme for it. What's the simpliest way to do it?
I have created new theme, filled _diffs folder with other folders, but it's empty and I couldn't find relevant docs about this. Should I copy all basic files there? What should I change to create footer?
In Liferay, theme's portal_normal.vm serves as the template to
construct HTML structure of the page. There you define your header,
body and footer includes.
When you will look at the portal_normal.vm of classic theme, you will observe following HTML snippet:
<footer id="footer" role="contentinfo">
<p class="powered-by">
#language ("powered-by")
Liferay
</p>
</footer>
This is the footer of the page. This is what you need to implement. However, it's not necessary to use footer tag at all, as you can simply use div or table based structure with bootstrap or customized CSS classes for your footer, it's upto your requirement.
Remember! Classic theme is just like a sample provided by Liferay, so, it's not good idea to directly customize it.
Everybody needs a whole customized view of the site, and for this the best idea is to create a custom theme (that's what you are doing!), that will give you full control over your look-n-feel.
To kick-start, you can initially copy required folders from classic theme to your customized theme's (_diffs folder) and start changing bit by bit.

Conflicts between Custom theme CSS and Liferay CSS

I am trying to customize the Liferay UI by using custom theme using base as as "_Styled" theme.
I have my own css files which I coped to _diff/css folder of theme and imported them "custom.css" file .However its breaking the presentation of liferay.In my custom CSS I have styles defined for all the standard tags like body,div etc which is impacting the liferay UI too.
How can I resolve this conflict? Thanks in advance!
Quick (and not the best) solution is to remove contents of liferays css file (for example "base.css") and save this empty file in /diff/css/ folder of your theme. This way the base.css will get overriden with your new empty file and thus no styles will get loaded. And your custom.css will be the only stylesheet that is taken into account.
Well, of course it all has an effect on the rest of Liferay as well. Liferay provides quite a bit of the HTML DOM of your page, and if you change the presentation of all of those elements, you'll have to take care to style Liferay's elements too.
Is this a conflict? No. Let's go for the simplest case: You declare div {color:green;}. Of course, now everything, your components as well as Liferay's components, use green text. If you only want to style your own portlets, you might want to specify some portlets: div.portlet-my-own-application {color:green;}
I know that color is a too simple usecase, but I hope it illustrates the solution strategy.
Rather than following Artem Khojoyan's suggestion to override Liferay's base.css, I'd recommend to take a look at the resulting css, what's effective etc., and simplify your own css - adapt it to be used within Liferay - by inspecting the effective CSS for every elements that looks off. Firebug or any of it's relatives are your friend.
I'm afraid, with the details "I'm doing something which has an effect on Liferay UI" there's nothing much more to help you. In fact, I'd hope that what you do has an effect on Liferay's UI... You'll just need to find the proper CSS code
Ideally if your styles are loaded from custom.css, then will overwrite liferay default styles.
In some cases, to overwrite a style in css, you can use !important
for example, liferay default style
body {
background-color: #fff
}
You can specify your style to consider irrespective of order of loading
body {
background-color: red !important;
}

Orchard Projection Isotope

I'm trying create an affiliate directory on my Orchard site. The directory is populated by running a query on my custom Content Type. The directory needs to be sortable and searchable. I've set up a basic jsfiddle here that is a basic functioning version of what I'm attempting to do, but it's just in html: http://orchard1.pha.jhu.edu/affiliates-beta-2
Or you can view the jsfiddle here: http://jsfiddle.net/tgelles/AMZf8/
Has anyone discovered a way to best use isotope on an Orchard Projection? I've downloaded the Projection Layout module, but I have no idea how to use that/where to inject the specific isotope code. I've also created alternate template files for the Projection's Summary display, but I don't know how to best inject the isotope plugin into that razor file.
Any help would be appreciated.
The best way would be creating a shape, but You could easily edit the query template and inject the js through a custom view for that projection(url,type, etc)
Check in your Queries.
There was a video which helped me understand better how they work: http://www.youtube.com/watch?v=Ka55wTTXZg8
Hope it helps.

How to add extra css to SharePoint 2007 site without reverting back to default theme

Currently I'm having trouble adding custom/my own css files to my SharePoint site. I add the custom/my own css files via the c# files (CssLink) as a web part and have them applied to my site's javascript files. Trouble is, whenever the css files were applied, my site goes back to the default blue-ish SharePoint theme color.
Is there any quick and simple way to avoid that from happening?
Thanks.
You can use this method to register a css file from a WebPart
Microsoft.SharePoint.WebControls.CssRegistration.Register("/.../mystyles.css")
or you can add the css file to the content place holder with the id "PlaceHolderAdditionalPageHead" which is present in the master page like this
var placeholder= Page.FindControl("PlaceHolderAdditionalPageHead");
var cssLink = new Literal();
cssLink.Text = "text";
placeholder.Controls.Add(cssLink);
Why don't you use, Site Settings, Master page and use the option "Specify a CSS file to be used by this publishing site and all sites that inherit from it." to specify your own CSS.
(Also, I have no idea what you mean with "via the c# files (CssLink) as a web part and have them applied to my site's javascript files". Are you missing some words in that sentence?)
You should have a very good reason to be adding CSSLink via C#. Have you considered packaging your CSS as your own theme?
SharePoint themes are easy to create and have many benefits such as:
a) Supported by Microsoft
b) Easy to create
c) Manageable by the end users.
d) You can apply different themes to different parts of the site.
e) etc etc...
The process of creating the theme can be found here:
http://sharepoint.microsoft.com/blogs/GetThePoint/Lists/Posts/Post.aspx?ID=122
I would recommend adding your theme via a feature only for adding and removing the theme. This would add a great deal of options for future tweaking.
Here is an example:
http://www.devexpertise.com/2009/02/11/installing-a-theme-as-a-sharepoint-feature/
I'm going to blog about this later this week so keep an eye out of you like. http://blog.zebsadiq.com
Upload your css in the syle library folder(or any library in side your site)
go to -->site actions-->site settings-->modify all site settings-->under look and feel tab-->click master page-->there is one option called alternate css url-->browse your custom css and click Ok.

Resources