替换 Magento 中的 getHomeLink
我可以将下面复制的 header.phtml 文件中的代码 getHomeLink() ?>
替换为 http://ourdomainname.com
>?
由于我们的 magento 商店是通过网站内的导航链接的,因此我们希望在标题中使用指向主域的链接,而不是使用商店域名。
感谢您的帮助。
<div class="header-top">
<a href="<?php echo $this->getHomeLink() ?>"><img src="<?php echo $this->getSkinUrl($this->__('images/logo.gif')) ?>” alt="<?php echo $this->__('Magento Logo') ?>” class="logo"/></a>
<div class="header-right">
<p class="super">
<?php echo $this->__("Logged in as %s", $this->getUser()->getUsername()) ?><span class="separator">|</span><?php echo $this->formatDate(null, 'full') ?><span class="separator">|</span><a href="<?php echo $this->getLogoutLink() ?>” class="link-logout"><?php echo $this->__('Log Out') ?></a>
</p>
<?php if ( Mage::getSingleton('admin/session')->isAllowed('admin/global_search') ): ?>
<fieldset>
<legend>Search</legend>
<span id="global_search_indicator" class="autocomplete-indicator" style="display: none">
<img src="<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>” alt="<?php echo $this->__('Loading...') ?>” class="v-middle"/>
</span>
<?php $defSearch = $this->__('Global Record Search') ?>
<input id="global_search" name="query" type="text" class="input-text" value="<?php if(!empty($query)): ?><?php echo $query ?><?php else: ?><?php echo $defSearch ?><?php endif ?>” onfocus="if(this.value==’<?php echo $defSearch ?>’)this.value=’’; “ onblur="if(this.value==’’)this.value=’<?php echo $defSearch ?>’;” />
<div id="global_search_autocomplete" class="autocomplete"></div>
<script type="text/javascript\">
new Ajax.Autocompleter(
‘global_search’,
‘global_search_autocomplete’,
‘<?php echo $this->getUrl('*/index/globalSearch') ?>’,
{
paramName:"query",
minChars:2,
indicator:"global_search_indicator",
updateElement:getSelectionId,
evalJSON:’force’
}
);
function getSelectionId(li) {
location.href = li.getAttribute(’url’);
}
</script>
</fieldset>
<?php endif; ?>
</div>
</div>
Can I just replace code <?php echo $this->getHomeLink() ?>
in the header.phtml file copied below with http://ourdomainname.com
?
Since our magento store is linked through navigation within our site, we want to use a link to our main domain in the header INSTEAD of using the store domain name.
Thanks for your help.
<div class="header-top">
<a href="<?php echo $this->getHomeLink() ?>"><img src="<?php echo $this->getSkinUrl($this->__('images/logo.gif')) ?>” alt="<?php echo $this->__('Magento Logo') ?>” class="logo"/></a>
<div class="header-right">
<p class="super">
<?php echo $this->__("Logged in as %s", $this->getUser()->getUsername()) ?><span class="separator">|</span><?php echo $this->formatDate(null, 'full') ?><span class="separator">|</span><a href="<?php echo $this->getLogoutLink() ?>” class="link-logout"><?php echo $this->__('Log Out') ?></a>
</p>
<?php if ( Mage::getSingleton('admin/session')->isAllowed('admin/global_search') ): ?>
<fieldset>
<legend>Search</legend>
<span id="global_search_indicator" class="autocomplete-indicator" style="display: none">
<img src="<?php echo $this->getSkinUrl('images/ajax-loader.gif') ?>” alt="<?php echo $this->__('Loading...') ?>” class="v-middle"/>
</span>
<?php $defSearch = $this->__('Global Record Search') ?>
<input id="global_search" name="query" type="text" class="input-text" value="<?php if(!empty($query)): ?><?php echo $query ?><?php else: ?><?php echo $defSearch ?><?php endif ?>” onfocus="if(this.value==’<?php echo $defSearch ?>’)this.value=’’; “ onblur="if(this.value==’’)this.value=’<?php echo $defSearch ?>’;” />
<div id="global_search_autocomplete" class="autocomplete"></div>
<script type="text/javascript\">
new Ajax.Autocompleter(
‘global_search’,
‘global_search_autocomplete’,
‘<?php echo $this->getUrl('*/index/globalSearch') ?>’,
{
paramName:"query",
minChars:2,
indicator:"global_search_indicator",
updateElement:getSelectionId,
evalJSON:’force’
}
);
function getSelectionId(li) {
location.href = li.getAttribute(’url’);
}
</script>
</fieldset>
<?php endif; ?>
</div>
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然可以。你可以做任何你想做的事,你只需要承担你采取的任何行动的后果。
Of course you can. You can do whatever you want, you just need to live with the consequences of whatever action you take.