How to change search result page from 3 to 1 columns in magento? - search

I have to change catalog search result page layout 3 from 1 columns layout. I have tried in catalogsearch.xml, but not getting proper result. Can anyone tell me how can I fix it?
Thank you.

Changing the layout in catalogsearch.xml should do the trick, done this way:
Before:
<action method="setTemplate"><template>page/3columns.phtml</template></action>
After:
<action method="setTemplate"><template>page/1column.phtml</template></action>
You should also clear your Magento Cache in admin>System>Cache Management.
Hope this helps.

Or you can in local.xml copy this:
<catalogsearch_result_index>
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
</catalogsearch_result_index>

Related

How to call new css file in magento

I am developing an online store in magento.I am editing the default theme of magento according to my new theme.
I wanted to know how can I call new css and js file to my default theme.
I tried making a blocktype in layout/page.xml like:-
<action method="addCss"><stylesheet>css/styles.css</stylesheet></action>
<action method="addCss"><stylesheet>css/bootstrap.css</stylesheet></action>
<action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 8</if></action>
css/widgets.css
css/print.cssmedia="print"
i want to add bootstrap.css file to my theme but its not included in the meta tag
Please help me
use
<reference name="head">
<action method="addCss">
<style>css/filename.css</style>
</action>
</reference>

Magento 1.7: Remove pagination from top and keep pagination at bottom

I am using magento 1.7. In my home page each category has pagination and the pagination appears in both top and bottom of the each category. I want to remove pagination from top and keep pagination in bottom.
For including pagination, I used the following code,
CMS > Pages > Design > Layout Update XML
<reference name="content">
<block type="catalog/product_list" name="home" template="catalog/product/list.phtml">
<action method="setCategoryId"><category_id>137</category_id></action>
<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
</block>
<action method="setToolbarBlockName"><name>product_list_toolbar</name><count>5</count></action>
</block>
</reference>
Hello for pagination use gettoolbarhtml() check following file
/app/design/frontend/default/your_theme/template/catalog/product/list.phtml
comment below line
// echo $this->getToolbarHtml()
You can achieve your goal with something like this:
<reference name="your_parent_block_name">
<remove name="block_name_you_want_to_remove"/>
</reference>

Joomla 2.5 ACL restrict to specific features/views

I seem to be having a problem identifying how to restrict Joomla 2.5 back-end users to specific features / Views in a custom component I am writing. According to my understanding I should be able to add my views as a section in the access.xml file. I have attempted this by naming a section the same name as my view but I don't seem to be able to change the access to that view independently from the component as a whole. Does anybody have a more in depth example I can review or tips? Is this even possible?
I believe what you are trying to do is not supported by Joomla.
My suggestion is to add a custom rule for views in access.xml
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
<action name="core.create" title="JACTION_CREATE" description="JACTION_CREATE_COMPONENT_DESC" />
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
<action name="core.edit" title="JACTION_EDIT" description="JACTION_EDIT_COMPONENT_DESC" />
<action name="core.edit.state" title="JACTION_EDITSTATE" description="COM_CATEGORIES_ACCESS_EDITSTATE_DESC" />
</section>
<section name="views">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
</section>
Then save your view in the #__assets table with a name like com_component.view.playerlist,
in the rules field you should save a JSON encoded list of your rules:
{"core.admin":{}}
You can check if current user can or cannot access a determinate section using JAccess
$user_id=JFactory::getUser()->id;
$has_permission = JAccess::check($user_id,'core.admin','com_component.view.playerlist');
if($has_permission){
draw_view();
}else{
JError::riseError(403,JText::_('PERMISSION_DENIED'));
// or
JError::raiseWarning(403,JText::_('PERMISSION_DENIED'));
}
If you have any doubt, feel free to comment.

Unset Additional info in Magento

I am wondering how to unset product additional info in layout.xml.I created local.xml and used <action method="unsetChild"><name></name>product_additional_data</name>.
But it is not working.Any suggestions?
Your XML snippet is badly formed. It looks like you were attempting:
<action method="unsetChild"><name>product_additional_data</name></action>
You might also try this:
<remove name="product_additional_data" />

DIV identified by WebDevToolbar isnt in file?

I'm trying to use Magento for my shopping cart and want to switch from a right col layout to left col. I've turned on ID/CLASS display on the Web Developer Toolbar in firefox, and am seeing ".main col2-right-layout", which i believe i must switch to ".main col2-left-layout", the alternate style is predefined. but running searches for files with the phrase "col2-right-layout" in them is only pulling up the style sheet. I am searching THE ENTIRE Magento directory. How is this possible? Not case sensitive, and I'm even searching hidden folders. How can it be?
**i have looked in that file, the div is not mentioned. **
Files are in app/layout/default/default/templates/page/
I've not got a dev copy of magento at home, thats all I can remember off the top of my head - will try and remember to confirm when at work.
If you want to swap the templates, you need to look in app/layout/default/default/layout/page.xml, plus some of the other xml files - the templates are defined there.
(Yes, magento's layout/templating system is complicated, and has a steep learning curve, but its worth it!)
col2-right-layout is mentioned in
app/design/frontend/base/default/template/page/2columns-right.phtml
or in Magento 1.3
app/design/frontend/default/default/template/page/2columns-right.phtml
If you want to swap the layout I'd suggest changing it in one of the layout xml files. For the shopping cart edit app/design/frontend/base/default/layout/checkout.xml
change
<checkout_cart_index translate="label">
<label>Shopping Cart</label>
<remove name="right"/>
<remove name="left"/>
<!-- Mage_Checkout -->
<reference name="root">
<action method="setTemplate"><template>page/1column.phtml</template></action>
</reference>
to
<checkout_cart_index translate="label">
<label>Shopping Cart</label>
<remove name="right"/>
<remove name="left"/>
<!-- Mage_Checkout -->
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
And similarly for the checkout page in the same file change
<checkout_onepage_index translate="label">
<label>One Page Checkout</label>
<!-- Mage_Checkout -->
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/2columns-right.phtml</template></action>
</reference>
to
<checkout_onepage_index translate="label">
<label>One Page Checkout</label>
<!-- Mage_Checkout -->
<remove name="left"/>
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template></action>
</reference>
As always it is better to make a copy of the file you are editing to your own theme.

Resources