I am new to Yii framework. I was working on drupal earlier, and the theming of drupal made sites are not difficult to manage. But I just want to know that how to create theme for the site with Yii framework.
I have gone through many sites, but still don't know where to start. For example I have checked http://www.yiiframework.com/doc/guide/1.1/en/topics.theming.
Now my doubts are:
Where to start for creating Yii themes? Suppose I want to change drupal theme to Yii, How can I do this?
Is it possible to have different theme for different pages? Like in drupal by using themekey module, we can have multiple theme for different pages.
It will be good if anybody will explain it step by step.
You can edit the layouts (protected/views/layouts/..). These are the wrapper views which are rendered around individual views rendered with render(), for example the site/index calls the index view (located at protected/views/index.php) using:
$this->render("index");
You can change the layout per action using:
$this->layout = "differentlayout";
You can set the layout for all actions within a Controller using:
public $layout='//layouts/differentlayout';
Obviously each layout can have a custom structure and loads different CSS and JS files. I know this isn't using the themes and theming but it is by far the most common way of customizing the look and feel of a Yii project
Here are some helpful links regarding YII theme development:
http://www.yiiframework.com/doc/guide/1.1/en/basics.view
http://www.yiiframework.com/wiki/249/understanding-the-view-rendering-flow/
http://mushfiq.me/2011/05/30/creating-a-yii-application-theme-from-a-html-template/
you can always download some of the simpler Yii Themes and see how they work.
--iM
Related
If I create custom static HTML landing page templates using the Bootstrap framework, what is the best way to integrate those into an existing website within Wordpress?
My goal is to be able to quickly integrate custom PPC landing pages into WP sites without having to deal with the poorly coded websites I often face.
Here's are some thoughts I had and the problems I'm experiencing:
I could place a folder in the website's root directory that holds the files for the custom template (separate from Wordpress). The issue I'm facing is how to handle all of the form submissions / fills and how to push them to a Google spreadsheet or CRM.
I could create a custom page template within the existing theme and just dump the static HTML template in there. But how could I do this in a way that it has it's own CSS / Images and doesn't effect any other page on the website?
Is one method better than the other? What would you recommend?
I appreciate it!
There really isn't an easy way. If you are looking to integrate the Wordpress navigation system, footer, and page creation system then you will have to create your templates using the Wordpress Theme Templating standard.
Start here: https://developer.wordpress.org/themes/basics/template-hierarchy/
Because of the way Wordpress enqueues its style and javascript files, among many other reasons, not following the template system will cause updating issues as well as restrict the ability for certain added plugins to function in the future.
You will have to write your static bootstrap templates as Wordpress templates.
I have converted a HTML page to Drupal template by using blocks and page.tpl.php file. Now I have another page that I need to convert and link it to the main navigation menu.
The problem is, that another page have completely different layouts and I don't understand how to create that layout and link it to the main menu. Is it really so complex? I found that it can be done by using panels but I am completely new in Drupal. I need a simple solution. Thanks if anyone can help me.
You can use some module like display suite or panels to create custom new pages with custom layout.
If you want to make all with code (and avoid database configurations), panels module is fully compatible with features (I don't know compatibility with display suite).
I need a custom template for the 'frontpage' and a custom template for all the other pages.
What are the best practices to accomplish this?
Do I need to make 2 themes or can I use the same theme?
Create 2 template files:
page--front.tpl.php for the front page.
page.tpl.php for other pages.
For further reading, check out Drupal 7 Template Suggestions.
Don't forget to clear the site cache after the creation of each new template file.
Hope this helps... Muhammad.
If you're new to Drupal theming, try using the Devel and the Themer Developer module (http://drupal.org/project/devel_themer)
I would like to direct you towards "The Drupal Way" (do it with flexible UI-based modules) if you are not already familiar with.
I would approach this problem using Panels and possibly Views if you need to display listed information on the page (such as a news-feed or similar).
This gives a whole different approach to setting up your site's content displays and it is the general direction of the Drupal ecosystem.
I found a article on the atk4 blog http://agiletoolkit.org/blog/integrating-agile-toolkit-with-wordpress/ I followed the instructions and i get a error and it says the ApiWeb Class not found. Then I looked in index.php on the real framework that you download and it initializes everything differently then the blog post did so. I'm wondering if ATK4 can be integrated or maybe I'm doing something wrong?
I'm also currently integrating a wordpress site with ATK4 at the moment.
The ApiWeb.php class is present in the atk4/lib directory in both 4.2 and 4.1.3 versions of atk4 so not sure why you are getting an error.
What is suggested on the blog page about integrating ATK4 with wordpress is that you would load the ATK4 libraries as php embedded in the pages so you would need to ensure you change the include line based on where you have placed the atk4 files.
<?php
include 'atk4/loader.php';
$api=new ApiWeb('sample_project');
$api->add('jUI');
.. .. ..
$api->execute();
?>
I havent tried this but think you would need to verify the path to ATK4 is correct.
I've taken a different approach to integrating Wordpress and ATK4 - rather than embedding ATK4 into the pages as per the blog article you referenced, i'm going with installing wordpress in one installation and ATK4 in a separate one and using the same template in both.
The wordpress template i'm using is from themeforest and it came with a WP folder containing the Wordpress files plus a HTML folder that contains example pages. I took one of the HTML pages and created a new templates/default/shared.html inserting the atk4 tags such as in the appropriate places.
I've created a menu in Wordpress Theme->xxx->Menu which are mostly static pages from Wordpress and one menu option which is a link to the start of the ATK4 root. Because i'm using the same template, it looks like a single site. In my case, i'm not using the login functionality of Wordpress - all the wordpress pages will be accessible without logging in but i am using a dynamic second level menu and options based on the logged in user which will be defined in Frontend.php
The ATK4 menu gave me a problem because it wasnt consistent with the site and after a while trying to style the menus with CSS and create a submenu using Menu_Basic and Menu_Lite, i went with using ATK4 Views and split the HTML from the wordpress theme, to create a menu.html, a submenu.html and a menuitem.html and have set this using code in Frontend.php
It's still a work in progress so i can't provide the link at the moment as it's not online yet but it seems to be working and may give you other ideas depending on what you want to achieve with integrating ATK4 and Wordpress.
If you want to have a common login for ATK4 and Wordpress (using ATK4 to control the access each user has), there is a plugin for Wordpress that might help with external DB Auth so you could use this with the BasicAuth of ATK4 instead of using Wordpress Auth functionality.
I need some help to theme my website a test project to learn cakephp 1.3.4. I have created files for these like default.ctp for website default layout. and home.ctp for home page layout, I try Google for help but there I found nothing a good tutorial for a beginner to help me understand how to use any theme or layout for cakephp website.
Can some give a reference link to any material that helps me to understand what exactly I have had to do with cakephp design techniques?
Look at this: Themes in CakePHP overall site book.cakephp.com is the best resource for learning CakePHP