dousuohe5882 2016-10-19 11:24
浏览 75
已采纳

如何在Shopware中管理SEO-Urls?

It seems that Shopware has some "magic behind" when generating URLs and i am looking for someone, who can explain this to me.

This is the code of standard-template to generate SEO-urls with variables which can be configured in SEO-router-settings in the backend:

{* Product name *}
{block name='frontend_listing_box_article_name'}
    <a href="{$sArticle.linkDetails|rewrite:$sArticle.articleName}"
       class="product--title"
       title="{$sArticle.articleName|escape}">
        {$sArticle.articleName|truncate:50}
    </a>
{/block}

The configuration in SEO-router-settings looks like this per default:

enter image description here

Anyway, the output is little different:

http://www.DOMAIN.de/shop/CATEGORYNAME/18/PRODUCTTITLE?c=7

(All capital letters demonstrates real correct domain-, category- and product-names, that are hidden here for the sake of privacy of my client)

The issue here is the URL-Parameter "?c=7" which isn't wanted and should be omitted as defined in SEO-router-options.

First question: how to omitt this URL-parameter "c=7" at the end of URL?

When i debug this code, i run into strange things. The following code will result in two different URLs although it is the same term executed:

enter image description here

These are the issues here:

  1. The output of {$sArticle.linkDetails|rewrite:$sArticle.articleName} is different between the href-Attribute and the second output as the caption of this link.
  2. The output of {$sArticle.linkDetails|rewrite:$sArticle.articleName} within href-Attribute will add an URL-Parameter to describe the id of the category, which isn't wanted: "?c=7"

Second question:

How can the same template-code be so different? What magic is there working behind the scenes?

  • 写回答

1条回答 默认 最新

  • douyin4561 2016-10-20 05:19
    关注

    I'm sure you are familiar with Shopware backend. See my answers in short:

    1. To remove "?c=7" from detail page urls:

    Set 'Remove CategoryID from Url = No' at Seo/router settings. Then clear cache.

    1. I think there is multiple shops exists or you migrated to shopware from other ecommerce systems.

    You can see the connection between those 2 links at "s_core_rewrite_urls" table. Just backup the table & empty it. Click on Configuration > Cache/performance menu item and do "Rebuild SEO URL index".

    More info available at https://developers.shopware.com/blog/2015/08/11/the-shopware-seo-engine/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Oracle触发器记录修改前后的字段值
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器