I'm trying to figure out where to edit footer links in magento 1.9 but I couldn't find anything I'll be searching it for almost 3hours but no success. Sorry I'm just a newbie in magento.
I want to edit the links under "QUICK LINKS" "ACCOUNT" I found the link under company and it's in magento backend under static blocks but no success for the two.
Thanks
These links are added in multiple layout files. The easiest way is to do a directory search (in your IDE) for "footer_links" phrase on the "layout/*.xml" files. You'll see that some links are being set in sales.xml, customer.xml or cms.xml. At the bottom of sales.xml for example you should see something like this:
<default>
<reference name="footer_links2">
<block type="sales/guest_links" name="return_link"/>
<action method="addLinkBlock"><blockName>return_link</blockName></action>
</reference>
</default>
This tells Magento to add the "Orders and Returns" link to the "Account" block in the footer. If you change the footer_links2 to footer_links, this link will end up in the "Quick Links" block. I think once you find this, you'll figure out the rest.
The other links and title are set via layout system:
page.xml:
<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/html_wrapper" name="bottom.container" as="bottomContainer" translate="label">
<label>Page Footer</label>
<action method="setElementClass"><value>bottom-container</value></action>
</block>
<block type="page/switch" name="store_switcher" as="store_switcher" after="*" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml">
<action method="setTitle"><title>Quick Links</title></action>
</block>
<block type="page/template_links" name="footer_links2" as="footer_links2" template="page/template/links.phtml">
<action method="setTitle"><title>Account</title></action>
</block>
<!-- This static block can be created and populated in admin. The footer_links cms block can be used as a starting point. -->
<!--<block type="cms/block" name="footer_social_links">
<action method="setBlockId"><block_id>footer_social_links</block_id></action>
</block>-->
</block>
Then in catalog.xml links are added:
<reference name="footer_links">
<action method="addLink" translate="label title" module="catalog" ifconfig="catalog/seo/site_map"><label>Site Map</label><url helper="catalog/map/getCategoryUrl" /><title>Site Map</title></action>
The links are available on Admin menu -> CMC -> static block
Here available Footer Links, and repalace/modify the required links.
on CMS/pages you can find an option to edit the footer whatever you want.
Bro, You can create your a custom static block and add it to your footer, just replace the old one. Hope that helps..cheers..
Hi it can also simple.
Paste in your style.css from your themes.
ul.links { display:none}
or on another class from the first block. And make new links in your first block in the admin by statisch block.
Related
I am using the ASP.NET MVC SiteMap provider in a project, and it is working great. I am having a tough time trying to figure out how to hide a menu item however. The menu item I want to hide from displaying in the global navigation is my "Site Map" page. Now I know that there is something called a VisibilityProvider available to me on the mvcSiteMapNode - but I can't seem to figure out how to make it work.
Taken from my answer here explaining how to hide nodes and options available.
https://stackoverflow.com/a/27095721/853295
You should use this guide on how to hide a node
https://github.com/maartenba/MvcSiteMapProvider/wiki/Advanced-Node-Visibility-with-ISiteMapNodeVisibilityProvider
Some settings you can set from the link above:
<appSettings>
<!-- Visibility will not filter to children -->
<add key="MvcSiteMapProvider_VisibilityAffectsDescendants" value="false"/>
<!-- Set default visibility provider -->
<add key="MvcSiteMapProvider_DefaultSiteMapNodeVisibiltyProvider" value="MvcSiteMapProvider.FilteredSiteMapNodeVisibilityProvider, MvcSiteMapProvider"/>
</appSettings>
Once you have added the app settings, add the following to any node you want to see in the breadcrumbs but not the menu:
visibility="SiteMapPathHelper,!*" (SiteMapPathHelper - the node is visible in the sitemappath, !* - it is invisible for all other controls)
eg:
<mvcSiteMapNode title="Administration" area="Admin" clickable="false" visibility="SiteMapPathHelper,!*" />
Other options available:
Type..........................What it Affects
CanonicalHelper.......The Canonical HTML Helper
MenuHelper..............The Menu HTML Helper
MetaRobotsHelper....The Meta Robots HTML Helper
SiteMapHelper..........The SiteMap HTML Helper
SiteMapPathHelper...The SiteMapPath HTML Helper
SiteMapTitleHelper...The Title HTML Helper
XmlSiteMapResult....The sitemaps XML output of the /sitemap.xml endpoint
First, I suggest you read this wiki page: Creating a Custom SiteMapNodeVisibilityProvider. Then for the specific node that points to your Site Map page, declare it this way:
<mvcSiteMapNode title="Site Map" controller="Home" action="Map" visibility="false" />
Now, when implementing the IsVisible method (shown in the wiki page linked above), you can do this:
string visibility = mvcNode["visibility"];
// Is a visibility attribute specified?
if (!string.IsNullOrEmpty(visibility))
{
isVisible = Convert.ToBoolean(mvcNode["visibility"]);
if (!isVisible)
{
return false;
}
}
return true;
I’ve created a menu in page.xml and it looks like this:
<reference name="primary.menu">
<action method="addLink" translate="label title">
<label>Test</label>
<url>test.html</url>
<title>Test</title>
<prepare>1</prepare>
<urlParams/>
<position>10</position>
<liParams>dark-gray</liParams>
<aParams></aParams>
<beforeText></beforeText>
<afterText></afterText>
</action>
...................
The class used for the primary.menu block is extending the Mage_Page_Block_Template_Links class from Magento’s core.
The problem is, that when I click this link it goes to ‘www.mydomain.com/test.html/’ which is not working. My question is what should I do in order to stop the last ‘/’ from showing in the url?
I think that <prepare>1</prepare> is building your URL query (in the absence of a dedicated helper to supply the URL) and as a result is prefixing your URL with the domain (which is what you want), but it is also appending a trailing slash (which is what you don't want)
Either create a helper to supply the "proper" URL.
If the page is a Magento CMS page, use that helper (preferred)
Use <prepare/> and <url>/test.html</url> (hack alert!)
To use a Magento CMS helper to add a link
<action method="addLink" translate="label title before_text" module="cms">
<label>Test</label>
<url helper="cms/page/getPageUrl">
<page_id>1</page_id>
</url>
<title>Test</title>
<prepare/>
<urlParams/>
<position>10</position>
<li/>
<a/>
<before_text/>
<after_text/>
</action>
I am trying to create product block on home page where in I copied page.xml to my theme's layout folder and modified it like
<page_two_columns_left translate="label">
<label>All Two-Column Layout Pages (Left Column)</label>
<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>
<reference name="content">
<block type="core/template" name="mycategories" output="toHtml" template="sweet/sweet.phtml"/>
</reference>
Here I was expecting one one block in the middle of my Home page and i am getting that but in addition to this i am getting one more block (same as this block sweet.phtml) at the bottom of home page.. below the footer link. Can anyone tell me whats the problem.
You've marked your block as an output block. When the view is rendered via renderView() in the controller action, your block is both a child of a block which echoes its children (content is a core/text_list block), as well as being an output block which will be rendered in its own right.
Remove the output="toHtml" bit and you will have what you need. By the way, you could / should move this change from a custom page.xml and into a local.xml file in your layout - it need only be inside a <page_two_columns_left /> layout update handle.
i'm trying to add some explanatory text to the top customer links (my account, my cart etc) via the customer.xml file from the blank theme (this is in Magento 1.4.1.1)
i think that magento has the capability out of the box by issuing afterText or beforeText parameters, but when i use them it only seems to shove things before the link (not after, which is what I'm after).
here's an extract from customer.xml that includes the additional < afterText > parameter:
<default>
<!-- Mage_Customer -->
<reference name="top.links">
<action method="addLink" translate="label title" module="customer"><label>Your Account</label><url helper="customer/getAccountUrl"/><title>Your Account</title><prepare/><urlParams/><position>10</position><null /><aParams>rel="nofollow"</aParams><afterText>click to login</afterText></action>
</reference>
</default>
has anyone had any luck with this before? does it need some additional arguments for liParams?
thanks in advance!
EDIT: here's the final code that seems to be working for me. Note the addition of the extra fields as suggested by
thanks for this, it helped a lot. both you and #Zyava answer below helped me sort it out.
There's one field missing from your suggestion above (the innerText field). I've put the full code below that looks to be working for me. hope it helps someone else!
<action method="addLink" translate="label title" module="customer">
<label>Your Account</label>
<url helper="customer/getAccountUrl"/>
<title>Your Account</title>
<prepare/>
<urlParams/>
<liParams/>
<aParams>rel="nofollow"</aParams>
<innerText/>
<beforeText>yourbeforetext</beforeText>
<afterText>youraftertext</afterText></action>
big thank you to #clockworkgeek and #zyava - both of your answers helped me get through this.
Unfortunately the XML tag names don't relate to the variable parameters, it is the number of parameters that matters. You need to specify all parameters up to afterText including beforeText.
<action method="addLink" translate="label title" module="customer">
<label>Your Account</label>
<url helper="customer/getAccountUrl"/>
<title>Your Account</title>
<prepare/>
<urlParams/>
<position>10</position>
<liParams/>
<aParams>rel="nofollow"</aParams>
<beforeText/>
<afterText>click to login</afterText>
</action>
Block 'top.links' has type Mage_Page_Block_Template_Links. Look at Mage_Page_Block_Template_Links::addLink() method:
public function addLink($label, $url='', $title='', $prepare=false, $urlParams=array(),
$position=null, $liParams=null, $aParams=null, $beforeText='', $afterText='')
{
As we can see, $afterText parameter exists here. Now go to your theme's page/template/links.phtml, in my case it is \app\design\frontend\base\default\template\page\template\links.phtml and check that something like <?php echo $_link->getAfterText() ?> is present there.
I notices when i go to some sites (include Stackoverflow) by Firefox a little blue circle shows I can add the site to my Search providers .
so wanted to know how can add this feature to my MVC project .
I Heared an XML file should be added ...
Follow the instructions in this guide.
This is the meat and veg of it though...
The link in your master page:
<link rel="search" type="application/opensearchdescription+xml" href="http://mysite.com/browserplugin.xml" title="My Site Search" />
The browserplugin.xml file mentioned above should look like this:
<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>My Site Search</ShortName>
<Description>My Site Search</Description>
<Image height="16" width="16" type="image/x-icon">http://mysite.com/favicon.ico</Image>
<Url type="text/html" method="get" template="http://mysite.com/search/{searchTerms}"/>
</OpenSearchDescription>
Note that you should (obviously) change that urls appropriately according to your website. Specifically the Url in the OpenSearchDescription in order to match your search url.