For logo:
There is an email var for that:
{{skin url="images/logo_email.gif" _area='frontend'}}
To make it your own, upload and replace logo_email.gif
For email variables:
Some of these exist by default:
General Store Email address:
{{config path="trans_email/ident_general/email"}}
Store Name:
{{config path="general/store_information/name"}}
Store Code is trickier. This is not exposed in the config to my knowledge for use by the email templates. I suggest using a custom template file, and refer this way:
{{block type="core/template" template="custom/storecode.phtml"}}
storecode.phtml:
<?php
echo Mage::app()->getStore()->getCode();
Alternatively, and maybe less-desirable, are Custom Variables.
Custom Variables
System > Custom Variable > Add New Variable
To Implement a custom variable into a Transactional Email, do the
following: In the Admin Panel, select System > Transactional Emails
Click the row of predefined template to edit or click [Add New
Template] button to create a new one. Create a new transactional email
first if needed. In the Template Content field, select a location for
your custom variable. Click [ Insert Variable ] and select the Custom
Variable you would like to insert.
Source: http://www.magentocommerce.com/knowledge-base/entry/creating-custom-variables
I think the main problem is that you should start to understand Magento's layout structure before you begin such a task.
I will try to give a brief tutorial; It may contain some errors and is mainly for structure.
First things first:
- You should turn on Magento Developer Mode.
- You should turn on Magento logging.
After that:
You are trying to create a new block. A block in Magento is not created simply by creating a template .php-file for it; instead, you will have to write a tiny module for it. There are some good tutorials out there how to create a Magento module, so I won't go deeper into detail about the config files and stuff.
How you create a block with a module:
Your module must contain a "Block"-folder and a file like this: app/code/local/[Companymame]/[Modulename]/Block/Catalog/Product/Featured.php
This Featured.php holds your business logic - another thing you are mixing up here: The featured.php in the /template/-folder should contain Template-Stuff, mainly to position the products in some fancy html, display some information (name, price, whatever), but should not contain the way to get the product; instead, there should be some line like $collection = $this->getProductCollection();
Featured.php should contain the class declaration for this block and the methods;
<?php
class [Companyname]_[Modulename]_Block_Catalog_Product_Featured {
function getProductCollection() {
// get the products and return them
$cat_id = 35
$category = Mage::getModel('catalog/category')->load($cat_id);
$collection = $category->getProductCollection()->addAttributeToSort('position');
Mage::getModel('catalog/layer')->prepareProductCollection($collection);
return $collection;
}
}
You have now your block class.
In your module's config.xml, add a paragraph and tell Magento that this module comes with a new block and a layout update:
<global>
<blocks>
<featured>
<class>[Companyname]_[Modulename]_Block_Catalog_Product_Featured</class>
</featured>
</blocks>
</global>
<frontend>
<layout>
<updates>
<featured>
<file>featured.xml</file>
</featured>
</updates>
</layout>
</frontend>
Magento's autoloader function checks the classname and automatically gets your block-file - no manual include of Featured.php is necessary.
The mentioned file featured.xml goes into the app/design/frontend/[package]/[theme]/layout/
folder and should contain the layout update. I don't know the correct path to the header-block atm and will leave it commented for this reason, but I hope you get the point:
<?xml version="1.0">
<!-- navigate to page/header block -->
<block type="[companyname]/[modulename]_catalog_product_featured" name="product.featured" as="topSlider" translate="label">
<label>Page Slider</label>
<action method="setTemplate"><template>catalog/product/featured.phtml</template></action>
</block>
<!-- close open nodes -->
Notice the differences to your xml-statement: The blockname fits the classname; I also added the template via the addTemplate-action and changed you featured.php to featured.phtml - do it the Magento way ;) (not sure if .php would work, though).
As I said above: The code I provided won't be free of errors, just typing this on a lazy Saturday evening ;) I hope you get the point, ask me questions if you need further help.
Best Answer
The best way to resize an image in
magento isVarien_Image
more clearly