How to use multiple themes in codeigniter like wordpress - codeigniter

I want to use multiple themes in codeigniter like wordpress.
e.g
Themes are A, B, C.
if i select Theme A then html would be change Theme A wise.
if i select Theme B then html would be change Theme B wise.
etc.
please help and thanks in advance.

Hi
Very hard to give this answer because your question is very out of range. :)
But I will try my best to do this.
Many way to build different themes put in CI
1) Use of CMS in codeigniter like
->http://www.getfuelcms.com/
->http://www.nodcms.com/en
2) Second way to do this things the easy way is to build your dynamic system as per your recruitment.
Also easiest way is to build your site in wordpress.

Although the library has it years(newer php version may scream error about &=, just delete & ) you can use https://github.com/philsturgeon/codeigniter-template - it uses theme concept. But you have to build database layer for themes usage logic. And if you know, which theme your site is using, then you just use method of the library: $this->template->set_theme($my_current_theme)

If you like a complete tutorial, check out this link
http://www.roytuts.com/using-template-in-codeigniter-3/. This is just an example, however and there's many more out there.
I agree with cssBlaster21895, that library can still be made to work for modern PHP versions. I just adjusted a few things and that made the errors disappear.

Related

Joomla - Help to create templates

I am starting to develop a frontend of a Joomla template.
Does anyone have a link to download or a db/dump or something with all components and categories activated?
Basically it's a demo dump to help me to show all components needed on any template.
Or... do I need to put it by hand?
You could try this: http://www.inmotionhosting.com/support/edu/joomla-3/create-template
I recommend you to use XAMPP and phpMyAdmin from it for your Joomla! start-up site - pretty easy and fast.

Can I use different themes for WordPress and BuddyPress

Is it possible to use two different themes for BuddyPress and WordPress ? If yes, please tell me how.
WP - 3.8.1
BP- 1.9.2
In general - no.
BuddyPress tightly integrated into WordPress, and uses it's templates, just adding some own html pieces on pages.
Of course, using some hacks you can change that, but that will result to problems in UX and maintaining all that code.
I think it's much better to have 1 theme, but for BuddyPress pages you can add additional styles and change html - BuddyPress allows to do that, you can redefine any template file.

How can I make a one page websites on joomla?

i'm trying out joomla! CMS, and in my job we're very fond of one-page sites. Is there any way of making a fully functional website with it? The main reason we need the CMS is because of the way the client wants to update they're webpage.
Ok before you do anything, have a real think to yourself, is Joomla really the best option? Your client requires a 1 page website, therefore what would be the point in loading a full blown CMS just for that. Joomla, when zipped up, is more or less 8MB. Out of all honestly, I would even find the likes of Wordpress still too big for a project of this size.
What I would really recommend is having a look round on the web for a very small CMS that simply includes a small backend with the ability to create, update and delete articles.
Have a look at this for example:
http://www.elated.com/articles/cms-in-an-afternoon-php-mysql/
This would be a brilliant way to start. It has a small backend for you to manage articles, and you can start building up a completely custom template, exactly to your client's liking. I'm not too sure on the programming skills but if you're fairly new to it, then this would be a good place to start and gain knowledge.
Given that the above is what I would personally recommend, you may not want to do that or may not have the time, therefore if you really want to stick with Joomla, you should find a template that fits your needs in regards to module positions. Else you can add your own custom positions to the template. Have a read through the documentation as it will give you the necessary information
Hope this helps
I was looking for a solution myself for quite a while. I came up with the following two soutions:
Like #mattosmat said for a joomla one page site the simplest solution actually is it to declare one section as the main componenent and create the other section with cusom-made joomla modules.
Use wordpress with the advanced field plugin to create a single-page website.
Actually if a clients wish is it to create a single page website with cck and cms features i create these projects in wordpress and not in joomla anymore in my opinion its the wrong plattform.
I Have One Word!!!
BOOTSTRAP!!!! IS the way to go.. simple,succinct,beginner friendly. Doesnt matter if you really make it in Joomla! or anything else.
And for head start, look up "Scrollspy" in Bootstrap.

Joomla 2.5 Add Option Groups to Article

I'm playing with Joomla 2.5.9 (The latest 2.X download). Do you know how you can add additional menu's to the "Article Manager: Edit Article" page? (This is in the Administration)
Their API gives me some hint on several things but I am don't know what this right "Slide Down Option Area" is called in the Administration.
In the right area there are things such as:
Publishing options
Article Options
Configure Edit Screen
Images and Links
etc..
I want to know where to start to add my own, or where they are already built in the system so I can base mine off it -- Is this a plugin, module, or something else? :)
As i say don't change any of the core file in Joomla. If you want to add any functionality into the article manager you can make your own plugin to add functionality in it. For doing this see this link :
Creating a content plugin
I hope this is what you looking for.Good luck.
There are some extensions that allow you to do that.
I recommend (although somewhat buggy and a code mess) this one:
FieldsAttach
It does exactly what you want.
Or, you could make your own as Toretto suggests, there are some tutorials on creating a plugin for extra items in the article form, but the already-made-extension route seems to make more sence.
I've been using FieldsAttach for this sort of thing, for a few years, the code is often a little messy, that is true, but the the concepts are clean and eloquent. Brian Teeman explains it well from an integrator point of view in his talk at https://www.youtube.com/watch?v=f2WLKWbRj5U but in some ways it is even more compelling from a developer's perspective.
However, after watching Marco Ding's Joomla Day UK 2016 talk on https://www.youtube.com/watch?v=KDh1IPuZAVA I think DPFields may be a better choice. The architecture is perhaps more rugged and neater, but also because it may well end up being a core extension in Joomla in the near future. More info on DPFields is at http://extensions.joomla.org/extension/dpfields , https://joomla.digital-peak.com/products/dpfields and https://joomla.digital-peak.com/documentation/162-dpfields .

Smarty integration into the CodeIgniter framework

A Little Background Information:
I've been looking at a few PHP framework recently, and it came down to two. The Zend Framework or CodeIgniter.
I prefer CodeIgniter, because of its simple design. It's very bare bone, and it is just kept simple. The thing I don't like though is the weak template system. The template system is important for me, because I will be working with another designer. Being able to give him a good template system is a big plus.
Zend was the second choice, because of the better template system that is built in. Zend is a different beast though compared to CodeIgniter. It emphasis "loose coupling between modules", but is a bigger framework. I don't like to feel like I have many things running under the hood that I never use. That is unnecessary overhead in my opinion, so I thought about putting a template system into CodeIgniter: Smarty.
Question(s): How easy/hard is the process to integrate Smarty into CodeIgniter? From my initial scan of the CodeIgniter documentation, I can see that the layout of the framework is easy enough to understand, and I anticipate no problems. I want to know if anyone has used it before, and therefore are aware of any "gotchas" you my have experienced that is going to make this harder than it should be or impossible to pull off. I also want to know if this is a good thing to do at all. Is the template system in CodeIgniter enough for normal use? Are there any other template modules that are good for CodeIgniter aside from Smarty? I better off with Zend Framework? Is any wheel being invented here?
Sorry to resurrect an old question - but none of the answers have been flagged as "accepted" yet.
There's a library called "template" that does a great job of allowing you to use just about any template parser you want:
Template CI Library - V1.4.1
The syntax is pretty easy for integrating into your CI application and the smarty integration spot on.
Slightly OT, hope you don't mind...
I'm a Zend Framework user and I think it's worth saying that the loose coupling means you don't need to include any files you're not actively using. Hopefully this negates your concern about unnecessary overhead.
With the layouts stuff added in a recent release of ZF, its templating is really hard to fault... and it's completely pluggable as Favio mentions. The more I use ZF, the more I like it; they do things the way I would do them!
I did a quick google search and found the following:
http://devcha.blogspot.com/2007/12/smarty-as-template-engine-in-code.html
http://codeigniter.com/forums/viewthread/67127/
If the designer is not familiar with Smarty, I think it's almost the same as if you use the existing CodeIgniter templating system (which leaves everything to PHP actually). It also depends on the complexity of the project at hand.
You can also hook Smarty with Zend Framework. It's more complex than with CodeIgniter, but there's already a primer on how to do exactly that in the ZF documentation. http://framework.zend.com/manual/en/zend.view.scripts.html Plus lots of tutorials on the net.
In my opinion it's almost the same, you can use pure PHP or Smarty as your template "engine", so it depends on the project. Also, compare a developer who has extensive experience and already has a library of view helpers so she uses pure PHP, versus a designer who doesn't know anything about PHP, but has extensive experience with Smarty. Sometimes decisions have to be based on who is going to do what.
Check out this custom CodeIgniter templating library. I've already used it on several projects and it is easy to use. I know this post is late but it's worth checking out.
It doesn't appear there has been an answer selected for this question nor has an up-to-date solution been given to work with the latest version of Codeigniter (2.0) and the latest version of Smarty (3.0.5).
This library allows you to use Smarty 3 with Codeigniter 2.0 so you can use Smarty 3 specific features like template inheritance.
http://ilikekillnerds.com/2010/11/using-smarty-3-in-codeigniter-2-a-really-tiny-ci-library/
Integrating Smarty in CodeIgniter? It is a breeze!
The template system in CodeIgniter is very basic.
Follow these steps for Smarty 3 in CI 3:
Download CodeIgniter 3
Download Smarty 3 and put its content in 'application/third_party/smarty' folder
Create 'Custom_smarty.php' file in 'application/libraries' and add this code:
<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once(APPPATH.'third_party/smarty/Smarty.class.php');
class Custom_smarty extends Smarty {
function __construct()
{
parent::__construct();
$this->setTemplateDir(APPPATH.'views/templates/');
$this->setCompileDir(APPPATH.'views/templates_c/');
}
}
?>
Create 'templates' & 'templates_c' folders inside 'application/views' folder
Create simple 'test.tpl' file in 'application/views/templates' folder
Open 'autoload.php' in 'application/config' folder and add:
$autoload['libraries'] = array('custom_smarty');
And inside a controller: $this->custom_smarty->display('test.tpl');
If you are working on localhost set the permissions: sudo chmod -R 777 templates_c. Otherwhise contact your hosting service, if you catch the error Unable to write file. First be sure templates_c folder exists.
Otherwise you can use another template engine like Twig.

Resources