[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1152
  • Last Modified:

Reorder/rename top right "quick-access" links in magento 1.5

Experts,

I have inherited a magento website and which i need to make some minor amends on.

I am struggling to find out exactly here within the source or magento back end that i edit the top right menu links. When viewing source they appear to be in a block called "quick-access", i have found a file in LAYOUTS that outputs those tags, but it appears to call in Quick links?

Im assuming these are set in the back end somewhere, but i cant find out where.

I need to rename them and also reorder them. Any suggestions?

In order to access the site you must add this line to your HOSTS file:
149.255.56.74 www.astridandmiyu.com

Thanks in advance

Easynow
0
Dean OBrien
Asked:
Dean OBrien
  • 4
  • 3
1 Solution
 
miked2004Commented:
These links are added via the layout xml files located in your theme.


Template file controlling it is:
/app/design/frontend/YOURHTHEME/YOURTHEME/template/page/html/top.links.phtml

This file mainly loops through the links and prints them out.


Block class controlling them is:
/app/code/core/mage/page/block/html/toplinks.php
SEE the AddLink Method.


To add or adjust the links you need to look into the layout files.
EX: The my account link, which you have relabeled as my A&M, is added from /app/design/frontend/YOURTHEME/YOURTHEME/layout/customer.xml
In that file you will see the following code.

<default>
        <!-- Mage_Customer -->
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>My Account</label><url helper="customer/getAccountUrl"/><title>My Account</title><prepare/><urlParams/><position>10</position></action>
        </reference>
    </default>

Open in new window


This is what adds the link. To add your own you just need to mimic the code above, but change the variables to fit your needs.

You can also update the code to adjust the position. Notice for the customer account link the position is set to 10.


Hope that helps!
0
 
Dean OBrienAuthor Commented:
First of all thanks for a very comprehensive answer, i now understand how that all works and have a good grasp of how to proceed.

One small question though... as you pointed out this is the line that renames the my account menu item:

<action method="addLink" translate="label title" module="customer"><label>My a and m </label><url helper="customer/getAccountUrl"/><title>My</title><prepare/><urlParams/><position>20</position></action>

You will notice that it doesnt use the ampersand, yet the ampersand displays on the page. Any ideas how this is done? I know that its definitely the correct line, because if i replace the "m" for a "t", then the menu goes from:
"a&m" -> "a and t"

I have a complete copy of all files on my computer, and have tried searching all files for the string "a&m" but it doesnt find it... i had originally though an if statement in the method might make the switch.

Reason i ask is that i want to add a poun sign in one of the menu items and i need to replicate the method.

regards
Easynow
0
 
miked2004Commented:
It looks like there are some wierd tags used, cufon, This is probably doing it, or has something to do with it.
Looks like there is something similar to sIFR running on the site.


CHeck the template file for custom logic: /app/design/frontend/YOURHTHEME/YOURTHEME/template/page/html/top.links.phtml
0
Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

 
Dean OBrienAuthor Commented:
There is definitely cufon replace running, but i dont think it is related.

I searched the entire magento file set and the only references to a&m are in the cache folder:
file:mage---2dc_TRANSLATE_EN_US_ADMINHTML_0_DEFAULT_FIND
line:a:2:{s:17:"Mage_Customer::My";s:6:"My a&m";s:26:"Mage_Customer::My a and m ";s:6:"My a&m";}

Given that it doesnt appear anywhere else im assuming this must be set in the database?

Checking now
Easynow

0
 
miked2004Commented:
I am 99.99999% sure that this data is not stored in the database.
Check all the files listed in my first post for logic to replace "My a and m" with "My a & m".

str_replace is probably used to do it.
0
 
Dean OBrienAuthor Commented:
Found it :)

Searched the db dump and found this:
core_translate` VALUES (1,'Mage_Customer::My',0,'My a&m','en_US')

Looks like the sole purpose of this table is for substituting strings etc, imagine it woiuld be used for swear words or something...

Thanks again for the help.

Easynow
0
 
miked2004Commented:
ah.. good to know. I did not know that existed. Thanks for posting that.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now