【问题标题】:How to modify the post interface of the telescope js如何修改望远镜js的post接口
【发布时间】:2015-07-24 05:30:31
【问题描述】:

我最近在学习基于 Meteor 构建的望远镜的源代码。我想修改帖子页面的界面。但是当我打开文件时 /packages/telescope-posts/lib/client/templates/post_body.html,找不到{{{htmlbody}}}的定义。谁能告诉我在哪里可以找到这个变量。我只是想修改帖子的界面,找不到是哪个文件或模板实现的。

post_body.html 如下:

<template name="post_body">
  <div class="post-body markdown" aria-live="polite">{{{htmlBody}}}</div>
</template>

【问题讨论】:

  • 似乎htmlBody 是相应文档的一个字段。三方括号用于将数据呈现为 HTML 元素。
  • 感谢您回答我的问题。你知道是哪个文件实现了post的接口吗?
  • “帖子界面”是什么意思?
  • 望远镜具有Post功能。我想更改帖子的网页(界面)。换句话说,我想自己设计页面。那么是哪个模板或文件在源码中实现了页面。
  • 我不明白你在做什么。你能详细说明一下吗?在我看来,您正在尝试修改 htmlBody 的设置方式。 {{{htmlBody}}} 表达式只输出来自/packages/telescope-posts/lib/client/templates/post_submit.html 的用户输入。是否要修改Posts集合中文档的数据结构?

标签: javascript meteor telescope


【解决方案1】:

您正在搜索的相应模板名为post_submit.html,位于/packages/telescope-posts/lib/client/templates/ (access file on GitHub)。

此模板当前包含meteor-autoform 包:

<template name="post_submit">
  <div class="grid grid-module">
    {{> quickForm collection="Posts" id="submitPostForm" template="bootstrap3-horizontal" input-col-class="controls" type="method" meteormethod="submitPost" fields=postFields}}
  </div>
</template>

这个包提供了一个extendable template system 和各种内置模板,比如bootstrap3。如果您想使用自己的类来自定义布局,请使用plain 模板,该模板将在没有框架的情况下生成 UI 元素。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-02-09
    • 1970-01-01
    • 2020-06-29
    相关资源
    最近更新 更多