如果条目id则显示某些内容
我一直在尝试使某些内容仅在表达式引擎中的某些entry_id上可见
{ifentry_id =“33”} ...显示某些内容 {/if}
这在 eemcs 中可能吗?
谢谢
I've been trying to make something visible only on certain entry_id in expressionengine
{if entry_id="33"}
... show certain content
{/if}
is this even possible in eemcs?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然可以 - 但您需要在提供该变量的标签对中使用 {entry_id} 变量。例如在 {exp:channel:entires} 标记对中。
如果您在 URI 中使用 url_titles,您可能需要考虑使用段变量。例如:
Sure - but you need to use the {entry_id} variable within a tag pair that provides that variable. For example within a {exp:channel:entires} tag pair.
If you're using url_titles in the URI you may want to think about using segment variables instead. For example:
这就是 EE 中所谓的简单条件,而且速度足够快。
在 EE 中要记住的一件非常重要的事情是,高级条件的标准 if:else/else:if 例程可能非常慢,主要是因为 EE 呈现所有代码段,然后发挥其 if:else 魔力。如果您发现自己测试了许多 ID 或组,这会相应地减慢网站速度。事实上,有时 EE 解析顺序可能会阻止 if:else 完全发挥作用。
相反,请考虑 Mark Croxton 的 Switchee,这是一个很棒的免费插件,可以让您拥有尽可能多的条件,即使是嵌套条件,也不会减慢速度。它只解析条件,然后在触发时,足够智能地下降并运行正确的代码段:
This is what's referred to as a simple conditional in EE, and it's fast enough.
One very important thing to remember in EE is that the standard if:else/else:if routine of an advanced conditional can be very slow, primarily because EE renders all of the code segments and then works its if:else magic. If you find yourself testing many ids or groups, this slows the site down proportionally. In fact, sometimes EEs parse order can stop if:else from functioning entirely.
Instead, consider Mark Croxton's Switchee, a fantastic free plugin that lets you have as many conditions, even nested conditions, without slowdown. It parses just the conditions, then when triggered, is smart enough to descend and run the right code segment: