password
password
模板渲染了密码页面,这是一个在商店应用密码保护时显示的登录页面。这个页面包括商家可以编辑的消息,以及供客户输入密码以访问商店的表单。
目录
password
模板位于主题的 templates
目录中:
└── theme
├── layout
├── templates
| ...
| ├── password.json
| ...
...
内容
你可以在密码模板或模板内容的某个 section 中包含以下内容:
如果你使用的是 JSON templates,那么任何 HTML 或 Handlebars 代码都需要包含在模板引用的 section 中。
密码消息
当商店启用密码保护时,还可以选择包含一条访客提示消息,这条消息可以使用 Handlebars shop 对象的 password_message
属性来展示:
<div class="password-modal__content-desc">
</div>
密码表单
密码表单可以通过使用 Handlebars form helper 以及相应的 'storefront_password'
参数来添加。在表单标签内,你需要包含具有以下属性的 <input>
和 <button>
:
- input -
type="password"
- input -
name="password"
- button -
name="commit"
例如:
<div class="password-field field">
<input type="password" name="password"/>
<label class="field__label" for="Password">Password</label>
</div>
<button name="commit" >Sign in</button>
return_to=routes.root_url
表示在用户成功登陆后,他们将被重定向到首页。
邮箱订阅表单
你可以使用 Handlebars form helper 和相应的 'customer'
参数来包含一个电子邮件注册表单,以捕获客户的电子邮件地址。在表单标签内,你需要包含以下内容:
Input | type | name | value |
---|---|---|---|
email | contact[email] | - |
例如:
<div class="field__container">
<input type="email" name="contact[email]" id="NewsletterForm" />
<label for="NewsletterForm" class="field__label">Email </label>
</div>
<div class="field__suffix">
<button type="submit" class="button button--link">
</button>
</div>
使用
如果你正在开发商店并开启了"开启密码保护", 客户将无法在商店上显示用户想看的页面,开发商店会始终跳转到密码页面。
尽管可自定义的密码页面不是用来控制对你的开发商店的访问,但在登录后,你仍然可以查看它,或者从 SHOPLINE admin 后台进行编辑。
要查看自定义的密码页面,已登录的访问者可以导航到 https://your-store-name.myshopline.com/Password
,其中 your-store-name
是开发商店的名称。
Error loading component.