Tumblr 中的元 if 标签有什么作用?
Tumblr 给出的示例是
<html>
<head>
<!-- DEFAULTS -->
<meta name="if:Show people I follow" content="1"/>
<meta name="if:Reverse pagination" content="0"/>
</head>
<body>
{block:IfNotReversePagination}
<a href="...">Previous</a> <a href="...">Next</a>
{/block:IfNotReversePagination}
{block:IfReversePagination}
<a href="...">Next</a> <a href="...">Previous</a>
{/block:IfReversePagination}
{block:IfShowPeopleIFollow}
<div id="following">...</div>
{/block:IfShowPeopleIFollow}
</body>
</html>
,对于这些元 if 标签,当我将 content="1" 更改为 content="0" 或 content="" 时,我的 tumblr 的外观似乎没有发生任何变化。 我不明白这些元 if 标签的作用。
根据 Tumblr 的说法:通过在主题中包含特殊的元 if 标签,用户可以轻松切换您定义的选项。这对于显示或隐藏不同的小部件或设计元素非常有用。
我理解这一点,因为您可以通过更改内容值来显示/隐藏不同的设计元素,即。内容=“0”,内容=“1”,内容=“”。但如果我这样做,设计似乎不会发生任何变化。
我用谷歌搜索了这个,但找不到任何详细说明 Tumblr 所说内容的解释。有人可以解释一下吗?
The example Tumblr gives is
<html>
<head>
<!-- DEFAULTS -->
<meta name="if:Show people I follow" content="1"/>
<meta name="if:Reverse pagination" content="0"/>
</head>
<body>
{block:IfNotReversePagination}
<a href="...">Previous</a> <a href="...">Next</a>
{/block:IfNotReversePagination}
{block:IfReversePagination}
<a href="...">Next</a> <a href="...">Previous</a>
{/block:IfReversePagination}
{block:IfShowPeopleIFollow}
<div id="following">...</div>
{/block:IfShowPeopleIFollow}
</body>
</html>
For these meta-if tags, when I change content="1" to content="0" or content="" nothing seems to happen to the appearance of my tumblr.
I don't understand what these meta-if tags do.
According to Tumblr: By including the special meta-if tags in your theme, users can easily toggle options you define. This is useful for showing or hiding different widgets or design elements.
I understood this as you can show/hide different design elements by changing the content value ie. content="0", content="1", content="". But nothing seems to happen to the design if I do this.
I googled this and I can't find any explanation elaborating on what Tumblr says. Can someone please explain?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Tumblr 使用元标签来保存主题的首选项。元 if 会导致用户在外观菜单上看到一个新的复选框。如果选中,
则会显示在您的页面上。
因此,页面源中应该有新的 div 元素,并且页面上显示三个点。
Tumblr uses meta tags to save preferences of the theme. Meta if will cause that user gets a new checkbox on the Appearance menu. If its checked than the
will be shown on your page.
So there should be new div element in the page source and three dots displayed on the page.
Bojan Dević 所说的是正确的。不过,我也想回答你问题的另一半。
content="1"
自动设置要显示的元素,或者content="0"
使其隐藏。What Bojan Dević said is correct. Although, I would like to address the other half of your question, as well.
content="1"
automatically sets the element to be shown, or ascontent="0"
makes it hidden.