如何在 bigcommerce 模板代码中获取当前页面的完整 url?

问题描述 投票:0回答:0

我正在尝试访问以下任一内容: https://testing.com/cat/?page=5 或者 /cat/?page=5

通过 bigcommerce 对象。然而,经过研究我只发现了以下代码:

{{ settings.request.absolute_path }}

这只会返回我 /cat/

但是我缺少 /cat/?page=5

那么谁能帮助我实现上述目标?我可以通过什么方式访问它?

我写了下面的代码:(当然下面不会使用绝对路径)

{{#if settings.request.absolute_path '===' 'https://testing.com/cat/?page=5' }}
    <meta name="description" content="The fifth page of cat products available." >
{{/if}}

bigcommerce 对象

bigcommerce bigcommerce-stencil-cli
© www.soinside.com 2019 - 2024. All rights reserved.