Follow this link:
http://www.pdfescape.com
Magento: create new template in magento
Step 1: Take a backup first. Make a backup of file we will be working with, it is located here:
app/code/core/Mage/Page/etc/config.xml
Step 2: Create new template
Create a new template file in the following directory (you may chose to simply copy an existing template, such as 1column.phtml) and name is with an appropriate name.
app/design/frontend/YOUR_INTERFACE/YOUR_THEME/template/page
whereas YOUR_INTERFACE typically remains “default” and YOUR_THEME can also be “default” (please see Design-Guide about proper naming of themes and interfaces)
Step 3
Edit config.xml to add the new layout template to the available options.
On line ~175 find:
[box]
Empty
page/one-column.phtml
1 column
page/1column.phtml
2 columns with left bar
page/2columns-left.phtml
2 columns with right bar
page/2columns-right.phtml
3 columns
page/3columns.phtml
[/box]
And insert the XML code for the new template where you want it to appear in the following format:
[box]
Layout Name
page/template_name.phtml
[/box]
Here is an example of the finished code block after inserting a new template named home.phtml:
[box]
Empty
page/one-column.phtml
Home
page/home.phtml
1 column
page/1column.phtml
2 columns with left bar
page/2columns-left.phtml
2 columns with right bar
page/2columns-right.phtml
3 columns
page/3columns.phtml
[/box]
Using the same steps, and modifying them for your application, you can crate new layout templates for use on any CMS page.
Be aware that until Magento changes the way layout templates are invoked, any update to the Magento code base will overwrite your changes, so make sure you have a backup of config.xml before you upgrade your Magento installation. The templates themselves will be fine, but you won’t be able to select them in the admin interface until you update config.xml so they show up.
To avoid this, make the change in (make a backup of config.xml and copy):
app/code/local/Mage/Page/etc/config.xml
Then in: app/etc/modules/Mage_All.xml Added in:
[box]
true
local
[/box]
Then finally, in the local module CMS, create folders Page and etc in local Mage, see :
app/code/local/Mage/Page/etc/config.xml
And in this file, make the amendment, it is untouchable by updating the core, because it is in the local folder.
WORDPRESS: Retrieve image size radio buttons with the specified one checked
// function to retrieve image size radio buttons with the specified one checked
//used to retrieve the image size
$check = get_user_setting(‘imgsize’, ‘medium’);
//end
function image_size_input_fields( $post, $check = ” ) {
// get a list of the actual pixel dimensions of each possible intermediate version of this image
$size_names = apply_filters( ‘image_size_names_choose’, array(‘thumbnail’ => __(‘Thumbnail’), ‘medium’ => __(‘Medium’), ‘large’ => __(‘Large’), ‘full’ => __(‘Full Size’), ‘medium22’ => __(‘Medium22’)) );
if ( empty($check) )
$check = get_user_setting(‘imgsize’, ‘medium’);
foreach ( $size_names as $size => $label ) {
$downsize = image_downsize($post->ID, $size);
$checked = ”;
// is this size selectable?
$enabled = ( $downsize[3] || ‘full’ == $size );
$css_id = “image-size-{$size}-{$post->ID}”;
// if this size is the default but that’s not available, don’t select it
if ( $size == $check ) {
if ( $enabled )
$checked = ” checked=’checked'”;
else
$check = ”;
} elseif ( !$check && $enabled && ‘thumbnail’ != $size ) {
// if $check is not enabled, default to the first available size that’s bigger than a thumbnail
$check = $size;
$checked = ” checked=’checked'”;
}
$html = “
$html .= “$label”;
// only show the dimensions if that choice is available
if ( $enabled )
$html .= ” ” . sprintf( “(%d × %d)”, $downsize[1], $downsize[2] ). “”;
$html .= ‘
‘;
$out[] = $html;
}
return array(
‘label’ => __(‘Size’),
‘input’ => ‘html’,
‘html’ => join(“\n”, $out),
);
}
IT SOFTWARE LAB (REGD.) – please like our facebook Page
About Us – IT SOFTWARE LAB (REGD.) is an (Delhi) India based company and we’ve been programming for our clients worldwide. Our success is dependent on the success of your project and organization and we stand by our work.
IT SOFTWARE LAB (REGD.)
WORDPRESS: Remove P TAG from content
Use filter to remove <p > TAG from the content:
remove_filter(‘the_content’, ‘p’);