how to find the links in the footer in magento - magento

I am trying to find the links in the footer of a magento website , but i am having difficulty finding the phtml file. I found the block code in the page.xml file
<block type="page/template_links" name="footer_links" as="footer_links" after="footer.newsletter" template="page/template/links.phtml"/>
but i cannot find the file links.phtml file , i checked the current template
website/app/design/frontend/website.com/default/template/page/
but i cannot see any template folder there.
Can anybody help me please with this, how to find the file, i even tried turning on template path hints it didn't help. Thanking you for your help in advance.

It can be confusing, the footer links i Magento are generated in one of two ways:
1) Added via XML layouts, which is how the sitemap link etc are added, example:
contacts.xml
<reference name="footer_links">
<action method="addLink" translate="label title" module="contacts" ifconfig="contacts/contacts/enabled">
<label>Contact Us</label>
<url>contacts</url>
<title>Contact Us</title>
<prepare>true</prepare></action>
</reference>
You can add more like this, or comment out to remove each link
They are generated using a standard template file (template/page/template/links.phtml) which is enabled in the config below. Each link definition as above (there's multiple in different xml configs) will use the template below to display the actual HTML link.
page.xml
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<!-- uncomment this to ditech them.. -->
<block type="page/template_links"
name="footer_links" as="footer_links"
template="page/template/links.phtml" />
</block>
2) You will find a static block called footer_links which also includes some links, this is to make it easier for you to add your own link. They are enabled inside
cms.xml
<reference name="footer">
<block type="cms/block" name="cms_footer_links" before="footer_links">
<!--
The content of this block is taken from the database by its block_id.
You can manage it in admin CMS -> Static Blocks
-->
<action method="setBlockId"><block_id>footer_links</block_id></action>
</block>
</reference>
Both methods are used to generate the footer links which can be confusing :)

Try this path:
/app/design/frontend/base/default/template/page/template
Hope that helps you...

to remove "orders and returns" from the footer link i had to comment out the block from sales.xml file
<!-- <default>
<reference name = "footer_links">
<block type="sales/guest_links" name="return_link"/>
<action method="addlinkBlock">
<blockName>return_link</blockName>
</action>
</reference>
</default>
-->

Related

Adding Cart to top.menu in Magento

I'm building a navigation bar that includes the user menu and cart along with the wishlist but trying to figure out how one would add it in the xml mockup to include it using the getChildHtml function.
XML file: page.xml
<block type="page/html_header" name="header" as="header">
I have
<block type="core/text_list" name="top.menu" as="topMenu" translate="label">
Now as far as I can see I have to include the following somewhere or extend the block or something not really sure, please help me in the right direction or even point me to a developers guide that would cover this.
<block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/>
Create a file local.xml in your theme folder app/design/frontend/your_package/your_theme/layout/
add the following lines and save the file.
<layout version="0.1.0">
<default>
<reference name="top.menu">
<block type="checkout/cart_sidebar" name="cart_sidebar" as="topcart" template="checkout/cart/sidebar.phtml"/>
</reference>
</default></layout>
Don't forget to clear magento cache(System->Cache management) after applying the change.
In order to learn more about Magento blocks ,layouts ,templates there is an official magento guide check it here

Magento: Change the block template in local.xml

I would like the product reviews page to use a different template instead of:
catalog/product/view.phtml
In review.xml, I see the file being called:
<block type="review/product_view" name="product.info" template="catalog/product/view.phtml">
Is there a way I can override that in local.xml and create a new file (ex: view2.phtml) and use that for this page?
<review_product_list>
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view2.phtml</template></action>
</reference>
</review_product_list>
Yes, you can definitely do that by writing the following code in local.xml:-
<reference name="product.info">
<action method="setTemplate"><template>catalog/product/view2.phtml</template></action>
</reference>
Here view2.phtml is your new file in the proper folder structure.
Hope it helps.

Magento: How to add js or css file in custom 2column-left page using page.xml file

In Magento, how to add js or css file in custom two column left page using page.xml file.
I am using the following code in page.xml at line:168
<page_two_columns_left translate="label">
<label>All Two-Column Layout Pages (Left Column)</label>
**<reference name="head">
<action method="addJs"><script>sidebar_menu.js</script></action>
</reference>**
<reference name="root">
<action method="setTemplate"><template>page/2columns-left.phtml</template> </action>
<!-- Mark root page block that template is applied -->
<action method="setIsHandle"><applied>1</applied></action>
</reference>
</page_two_columns_left>
I can use the js/css by putting it in 2column-left.phtml but I don't thing it is convenient way. I want to add using xml.
Are the two asterisks up there actually on your code? If not, basically what you're doing there is correct. however:
<handle>
<reference name="head">
<action method="addJs"><script>prototype/prototype.js</script></action> <!-- adds a js referencing to the /js directory -->
<action method="addCss"><stylesheet>css/custom.css</stylesheet></action> <!-- adds CSS looking at the skin/ directories ( in reverse order: base/default, default/default, default/yourtheme, yourpackage/yourtheme -->
<action method="addItem"><type>skin_js</type><name>js/custom_script.js</name><params/></action> <!-- adds a js at the skin/ directories in the same manner as the above addCss directive -->
</reference>
<handle>
Please note that can be replaced by either default,modulename_controller_action e.g catalog_cart_index or in your case, page_two_columns_left
It is best to modify local.xml instead found inside app/design/frontend/yourpackage/yourtheme/layout/ if you have a custom skin to work with.
As much as possible, please don't touch page.xml inside the app/design/frontend/base/default/layout/ directory.

Adding image in Magento via update layout

I'm trying to figure out how to add images, etc. to the left sidebar portion of a 2 column with left sidebar page in Magento using the layout update in the cms ->page->design portion of the admin area.
Is it possible to do this from the update layout xml area? If not, could you explain how to create a module (or whatever else would be required).
Thanks.
If you look in base/default/layout/catalog.xml, you will see an example of using a template with an image placeholder that can be specified in your Update Layout XML area:
<reference name="left">
<block type="core/template" name="left.permanent.callout" template="callouts/left_col.phtml">
<action method="setImgSrc"><src>images/media/col_left_callout.jpg</src></action>
<action method="setImgAlt" translate="alt" module="catalog"><alt>Our customer service is available 24/7. Call us at (555) 555-0123.</alt></action>
<action method="setLinkUrl"><url>checkout/cart</url></action>
</block>
</reference>
So, in your Update Layout XML, you would write something like:
<reference name="left.permanent.callout"> <!-- match this to the block name from above -->
<action method="setImgSrc"><src>images/media/my_file_name.jpg</src></action>
<action method="setImgAlt" translate="alt" module="catalog"><alt>Some text here</alt></action>
<action method="setLinkUrl"><url>your/path</url></action>
</reference>
You can adapt that by taking a copy of the template file left_col.phtml and making changes as you wish.

Magento - Adding to the Layout

I have this section in one of my layout files:
<blog_post_view>
<reference name="content">
<block type="blog/post" name="post" template="aw_blog/post.phtml" />
<block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
</reference>
</blog_post_view>
This first block shows a post and the second block shows some social bookmarking icons. The problem is the section which displays the post also displays the 'add comments' section. I want to add the social icons between the post and the comments.
How can I do this? Ie. add the Social block in the middle of the Post block?
Thanks!
Change it to:
<blog_post_view>
<reference name="content">
<block type="blog/post" name="post" template="aw_blog/post.phtml">
<block type="socialbookmarking/bookmarks" name="bookmarks" template="bookmarks/bookmarks.phtml"/>
</block>
</reference>
</blog_post_view>
and then inside the post template (aw_blog/post.phtml) put the following where you want the bookmark-things to appear:
<?php echo $this->getChildHtml('bookmarks'); ?>

Resources