1

I'm looking for changing log in the label to button!plz help I'm so lost with that tuto; without result!! :( !by the way, it's about login link on top links

2
  • I'm afraid this has nothing to do with Magento itself, but more with pure HTML/CSS Commented Dec 11, 2015 at 9:34
  • There are a couple of login links in magento. Which one are you refering to? Commented Dec 11, 2015 at 10:25

2 Answers 2

2

The link code is app/design/frontend/yourtherme/default/template/page/html/top.links.phtml

For changing label app/design/frontend/yourtherme/default/layout/customer.xml line 75

<customer_logged_out>
        <!---<reference name="right">
            <block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>
        </reference>-->
        <reference name="top.links">
            <action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
        </reference>
        <remove name="reorder"></remove>
    </customer_logged_out>
1

If I well understood, you wanna change top link "log in" link into a ? To do that you can create the following template : app/design/frontend///template/page/template/loginlink.phtml containing this code :

<?php
    /** @var Mage_Core_Block_Template $this */
?>

<li<?php if($this->getIsFirst()||$this->getIsLast()): ?> class="<?php if($this->getIsFirst()): ?>first<?php endif; ?><?php if($this->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $this->getLiParams() ?>>
    <?php echo $this->getBeforeText() ?>
    <form action="<?php echo Mage::helper('customer')->getLoginUrl(); ?>" method="POST">
        <button type="submit" value="<?php echo $this->getTitle() ?>"><?php echo $this->getTitle() ?></button>
    </form>
    <?php echo $this->getAfterText() ?>
</li>

If it's not already done, you'll have to copy the app/design/frontend/base/default/layout/customer.xml to app/design/frontend/"my_package"/"my_theme"/layout/customer.xml.

You'll have to change the node under this way :

<customer_logged_out>
    <!---<reference name="right">
        <block type="customer/form_login" name="customer_form_mini_login" before="-" template="customer/form/mini.login.phtml"/>
    </reference>-->
    <reference name="top.links">
        <block type="core/template" name="login_link" template="page/template/loginlink.phtml">
            <action method="setData">
                <name>title</name>
                <value>Log In</value>
            </action>
        </block>
        <action method="addLinkBlock"><blockName>login_link</blockName></action>
        <!--<action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>-->
    </reference>
    <remove name="reorder"></remove>
</customer_logged_out>

Not the answer you're looking for? Browse other questions tagged or ask your own question.