opencart中信息页面的SEO URL

时间:2013-10-28 09:04:44

标签: php opencart

我在标题中创建了一个自定义菜单,我将链接放到About UsRegisterContact Us

现在我想利用SEO网址。我在SEO中设置了SEO URL关键字,并且所有页面都正常工作,但自定义链接无效。

这是我添加到标题

的自定义代码
<div class="nav">
      <ul>

        <li><?php foreach ($categories as $category) { ?><a href="<?php echo $category['href']; ?>"> <?php }?> Products</a></li>
        <li><a href="index.php?route=account/register">Register Now</a></li>
        <li><a href="index.php?route=information/information&information_id=4">About Us</a></li>
        <li><a href="index.php?route=information/information&information_id=7">The Company</a></li>
        <li><a href="index.php?route=information/information&information_id=8">iPhone App</a></li>
        <li><a href="index.php?route=information/contact">Connect@Cobra Razors</a></li>

        </ul>
    </div>

1 个答案:

答案 0 :(得分:1)

OpenCart使用URL类来处理所有链接。它的格式为

$this->url->link('route_here', 'parameters_here', 'SSL/NONSSL');

但是只需要第一个参数(route)。例如,您上面的Register Now链接就是

<a href="<?php echo $this->url->link('account/register'); ?>">Register Now</a>

然而,它应该是一个安全页面,因为客户需要输入敏感数据,因此您需要使用HTTPS链接进行链接(如果您的商店不支持SSL,将自动设置为HTTP),因此我们需要设置SSL的第三个参数。如果我们不这样做,默认设置为NONSSL

<a href="<?php echo $this->url->link('account/register', '', 'SSL'); ?>">Register Now</a>

正如您将注意到的,第二个参数只是一个空字符串。这是因为它没有任何额外的参数。这会将我们带到您的信息页面链接,这些链接需要information_id参数

<a href="<?php echo $this->url->link('information/information', 'information_id=4'); ?>">About Us</a>"
相关问题