如何在Squarespace Developer模式下修改集合的.item模板?

时间:2016-05-15 00:02:53

标签: collections blogs squarespace

我想在Developer模式下修改Native模板的现有blog.item模板。我想知道这是否可行,因为当我修改文件并上传回服务器时,没有识别出任何更改,正如我在Chrome开发者工具中看到的那样。例如,我在div中添加了一个类,保存并上传,我的FTP管理器显示成功,但是当我在开发人员工具中查看时,该类不存在。我已经退出(FTP)并重新登录。我知道FTP正在运行,因为tweak.less文件工作正常。

另外,具体我要编辑的是文章元。为每个帖子显示的作者,日期,喜欢。我的意思是,一般来说,因为我认为这与方空间系统变量有关,这可能就是为什么我似乎无法编辑它?

编辑************ 这是blog.item文件中的代码

<header>
            {.if title}<h1 class="entry-title" data-content-field="title" itemprop="headline">{.passthrough?}<a href="{sourceUrl}">{title} <span>&rarr;</span></a>{.or}<a href="{fullUrl}">{title}</a>{.end}</h1>{.end}
            <div class="article-meta-top">
      {.section location}<div class="location">{.if addressTitle}<a href="//maps.google.com/maps?q={mapLat},{mapLng}" target="_blank" title="View map in new window"><i class="icon-map-marker"></i>{addressTitle}</a>{.end}</div>{.end}
      <span class="date"><a href="{fullUrl}"><time class="published" datetime="{addedOn|date %F}" itemprop="datePublished">{addedOn|date %B %d, %Y}</time></a></span>
       {.section author}<span class="author"><a href="{collection.fullUrl}?author={id}" rel="author">by {displayName}</a></span>{.end}
      {.section categories}<span class="categories">in {.repeated section @}<a href="{collection.fullUrl}?category={@|url-encode}" rel="tag">{@}</a>{.alternates with}, {.end}</span>{.end}

然后我简单的想移动是在帖子页脚那里发贴标题所以我采取了帖子页脚代码并将其移动到那里。

<header>
            {.if title}<h1 class="entry-title" data-content-field="title" itemprop="headline">{.passthrough?}<a href="{sourceUrl}">{title} <span>&rarr;</span></a>{.or}<a href="{fullUrl}">{title}</a>{.end}</h1>{.end}
            <div class="article-meta">
                  <span class="date"><a href="{fullUrl}"><i class="icon-calendar"></i><time class="published" datetime="{addedOn|date %F}" itemprop="datePublished">{addedOn|date %B %d, %Y}</time></a></span>
                  {.section author}<span class="author"><span class="delimiter">/</span><a href="{collection.fullUrl}?author={id}" rel="author"><i class="icon-user"></i>{displayName}</a></span>{.end}
                  {.passthrough?}{.or}{.section sourceUrl}<span class="source"><span class="delimiter">/</span><a href="{sourceUrl}" target="_blank"><i class="icon-share"></i>Source</a></span>{.end}{.end}
                  {.section tags}<div class="tags"><i class="icon-tag"></i>{.repeated section @}<a href="{collection.fullUrl}?tag={@|url-encode}" rel="tag">{@}</a>{.alternates with}, {.end}</div>{.end}
                  {.section categories}<div class="categories"><i class="icon-bookmark"></i>{.repeated section @}<a href="{collection.fullUrl}?category={@|url-encode}" rel="tag">{@}</a>{.alternates with}, {.end}</div>{.end}

                  <div class="shareLoveButtons">
                    {@|like-button}
                    {@|social-button-inline}
                    {postItemInjectCode}
                  </div>
              </div>

我意识到这可能是针对社区问题的具体问题,所以我不会问这个工作本身是什么,只要它应该有效。如果没有,为什么?我在哪里可以找到相关的文件?我查看了所有的开发人员文档,但我没有看到它在哪里谈论它。我缺少注释或代码注入的东西吗?

1 个答案:

答案 0 :(得分:0)

我会先仔细检查你的FTP设置。实际上,不支持FTP协议,只有SFTP和Git。请务必遵循以下说明:http://developers.squarespace.com/initial-setup

我可以告诉您使用Squarespace开发者模式24/7,我没有遇到过我的更新无法访问服务器的问题,所以我的猜测是您的SFTP应用程序不是&#39 ; t配置正确。

您是否能够首先下载模板文件到您的计算机?根据你的措辞,听起来你可以做到。

&#34;开发人员&#34; CMS内的页面显示?它应该在那里显示你的SFTP / Git活动。