Option 1: use local.xml
You can target specific products or categories from local.xml.
For product page, there are two additional layout handles:
<PRODUCT_TYPE_[type_id]>
<PRODUCT_[product_id]>
For categories:
Option 2: admin backend
Go to admin product/category edit page and add your layout updates do Custom Layout Updates
section.
Edit: (not tested)
Add your layout updates to local xml - with an own handle name ... and in layout update section just add <update handle="my_layout_handle"/>
Maybe usefull if you want to apply your layout on several pages.
Option 3: custom layout handle
If you want to apply layouts for different products or on special conditions, you can add you own layout handles ... something like this:
public function addPreviewHandle(Varien_Event_Observer $observer)
{
$action = $observer->getAction();
if ($action->getFullActionName() === 'catalog_product_view'
&& $action->getRequest()->getParam('preview') === 'true') {
$update = $observer->getEvent()->getLayout()->getUpdate();
$update->addHandle('my_admin_product_preview');
}
}
and layout update ...
<layout version="0.0.1">
<my_admin_product_preview>
...
</my_admin_product_preview>
</layout>
Update:
When I make a specific view.phtml for only this category, How can I
select the right product view for this different layout.
Either in layout XML
<CATEGORY_123>
<reference name="product.info">
<action method="setTemplate">
<template>path/to/file.phtml</template>
</action>
</reference>
</CATEGORY_123>
Or in backend settings for this category
<reference name="product.info">
<action method="setTemplate">
<template>path/to/file.phtml</template>
</action>
</reference>