首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >五星级评级和评论

五星级评级和评论
EN

Drupal用户
提问于 2013-11-12 05:23:46
回答 2查看 2.8K关注 0票数 -1

我有比赛的细节。我想打分和审查每一个比赛的细节。在这里,我显示了比赛的所有细节,我已经安装了投票和五星评分模块。但我无法联系到比赛的细节。如何使它使当点击“比赛细节”,它将移动到一个新的页面与比率和审查选项?

我使用自定义模块来显示比赛细节。

EN

回答 2

Drupal用户

发布于 2013-11-12 06:43:44

如果要在单独的页中显示注释,则需要在新页中配置“注释表单”显示。

内容类型的注释设置:

  • 转到管理->结构->内容类型
  • 编辑内容类型。
  • 选中“注释设置”部分下的“在与注释相同的页面上显示回复表单”复选框并保存表单。

现在,您可以在代码中添加www.example.com/comment/reply/[nid]#comment-form链接,以便将注释链接到单独的页面中。

请确保[nid]是您的节点id。

如果您在评论中添加了“评级”,那么它也将显示在相同的页面中。

更新:

添加评等(五星级)字段到评论部分:

  • 转到Administration -> Structure -> Content types
  • 单击内容类型行中的Manage fields链接,它将为您的内容类型重定向到fields设置页面。
  • 单击页面顶部的comments fields链接,您可以管理“评论”部分的字段。
  • 在注释中添加fivestar rating字段类型的新字段。
  • Voting target在您的fivestar rating字段的字段配置中应该是parent node
票数 1
EN

Drupal用户

发布于 2014-12-29 10:25:50

设置内容类型(节点类型)

代码语言:javascript
运行
复制
Go to the admin/config/content/fivestar
Create a new Tag called "Rating" (e.g. vote, Rating).
Go to your content type.
Add a new Fivestar Field, called "Rating".
Select Widget type: Stars (rated while viewing).
Save Field.
Select Tag: Rating.
Save field Settings
Select 'Number of stars' (Make sure it will be the same on both the content type and the comments
Be sure to check "Allow users to vote on their own content" otherwise you won't be able to test it working on your own content
Make any other customizations
Save Settings
Go to your content type's display settings.
Click the settings button (gear icon on the right side) for the "Rating" field.
Make sure Value to display as stars is set to 'Average Vote'
Make any other customizations.
Click 'update'
Save your content type

设置评论/评分

代码语言:javascript
运行
复制
Go to the comment field settings for the content type we just added our field to.
Use 'Add existing field' and add the same 'Rating' field you used on the content type.
Widget: "Stars (rated while editing)".
Save Field.
Select 'Number of stars' (Make sure it is the same as the content type you created above.).
Select Voting Tag: Rating.
Voting target: **Parent Node**.

Voting Target
Make any other customizations.
Save settings.
Go to the comment display settings.
Click the settings button (gear icon on the right side) for the "Rating" field.
Change Value to display as stars: User's Vote.
Change Text to display under the stars: User's vote
Make any other customizations.
Click update.
Click save.
Voila!
P.S. If you use 7x-2.x version of fivestar module, please, first check out this issue to make it work according to new voting api changes. NOTE: The whole setup works just fine with Fivestar 7.x-2.x-dev from 2014-Mar-24 and Voting API 7.x-2.12
票数 1
EN
页面原文内容由Drupal提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://drupal.stackexchange.com/questions/93934

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档