If statement Expressionengine if语句销毁代码
我终于(我想)在ExpressionEngine中使用多语言替代wiki实现了第二种语言 我遇到的问题是,当我尝试添加以下if语句(或其他语句)时 在我的导航标签周围,整个页面都被破坏了。 在查看源代码时,添加if语句会删除它前后的大量代码 它删除了语句前后的结束标记,有效地将页面发送到所有地方 有人知道为什么会这样吗 编辑:以下是完整代码:If statement Expressionengine if语句销毁代码,if-statement,expressionengine,If Statement,Expressionengine,我终于(我想)在ExpressionEngine中使用多语言替代wiki实现了第二种语言 我遇到的问题是,当我尝试添加以下if语句(或其他语句)时 在我的导航标签周围,整个页面都被破坏了。 在查看源代码时,添加if语句会删除它前后的大量代码 它删除了语句前后的结束标记,有效地将页面发送到所有地方 有人知道为什么会这样吗 编辑:以下是完整代码: <div id="top_links"> <ul id="top_links_list">
<div id="top_links">
<ul id="top_links_list">
<li>t: +33 (0)467 45 90 00</li>
<li>e: <a href="mailto:#>Email</a></li>
{if segment_1 == "hotel" OR segment_1 == "contact"}
<li class="hotel_reserve">
<a href="#" target="_blank">{if country_code == "fr"}Réservez votre séjour{/if}{if country_code == "en"}Reserve your stay{/if}</a>
</li>
{/if}
{if segment_1 == "restaurants" AND segment_2 !="reservations" AND segment_2 !="merci"}
<li class="restaurants_reserve">
<a href="{path="restaurants/reservations"}">{if country_code == "fr"}Réservez votre table{/if}{if country_code == "en"}Reserve your table{/if}</a>
</li>
{/if}
{if segment_1 == "golf" AND segment_2 !="reservations" AND segment_2 !="merci"}
<li class="golf_reserve">
<a href="{path="golf/reservations"}">{if country_code == "fr"}Réservez votre départ{/if}{if country_code == "en"}Reserve your tee-time{/if}</a>
</li>
{/if}
{if segment_1 == "evenements" AND segment_2 !="reservations" AND segment_2 !="merci"}
<li class="evenements_reserve">
<a href="{path="evenements/reservations"}">{if country_code == "fr"}Demandez un devis{/if}{if country_code == "en"}Get a quote{/if}</a>
</li>
{/if}
{if segment_1 == "competitions" AND segment_2 == "view"}
<li class="competitions_retour">
<a href="{path="competitions"}">{if country_code == "fr"}Retour au page compétitions{/if}{if country_code == "en"}Return to competitions page{/if}</a>
</li>
{/if}
{if segment_1 == "competitions" AND segment_2 == "merci"}
<li class="competitions_retour">
<a href="{path="{segment_1}"}">Retour au page {segment_1}</a>
</li>
{/if}
{if segment_1 == "golf" AND segment_2 == "merci"}
<li class="competitions_retour">
<a href="{path="{segment_1}"}">Retour au page {segment_1}</a>
</li>
{/if}
{if segment_1 == "restaurants" AND segment_2 == "merci"}
<li class="restaurants_reserve">
<a href="{path="{segment_1}"}">Retour au page {segment_1}</a>
</li>
{/if}
{if segment_1 == "evenements" AND segment_2 == "merci"}
<li class="evenements_reserve">
<a href="{path="{segment_1}"}">Retour au page {segment_1}</a>
</li>
{/if}
{if segment_1 == "merci"}
<li class="evenements_reserve">
<a href="{path="contact"}">Retour au page contact</a>
</li>
{/if}
{if segment_1 == "events" AND segment_2 == "view"}
<li class="evenements_reserve">
<a href="{path="events"}">Retour au page Events</a>
</li>
{/if}
</ul>
</div> <!-- end top links -->
{if country_code == "fr"}
{exp:navee:nav nav_title="main_nav" id="nav" parent_selected_class="parent_selected" selected_class_on_parents="true"}
{/if}
</div> <!-- end top right area -->
<div class="clear"></div>
</div> <!-- END TOP AREA -->
- 电话:+33(0)467459000
- e:
{如果段1==“酒店”或段1==“联系”}
-
{/if}
{如果段1==“餐厅”和段2!=“预订”和段2!=“谢谢”}
-
{/if}
{如果第1段==“高尔夫”和第2段!=“预订”和第2段!=“谢谢”}
-
{/if}
{如果段_1==“evements”和段_2!=“reservation”和段_2!=“merci”}
-
{/if}
{如果段_1==“竞争”和段_2==“查看”}
-
{/if}
{如果段_1==“竞赛”和段_2==“merci”}
-
{/if}
{如果段_1==“golf”和段_2==“merci”}
-
{/if}
{如果段_1==“餐厅”和段_2==“merci”}
-
{/if}
{如果段_1==“evements”和段_2==“merci”}
-
{/if}
{如果段_1==“merci”}
-
{/if}
{如果段_1==“事件”和段_2==“视图”}
-
{/if}
{如果国家/地区代码==“fr”}
{exp:navee:nav nav\u title=“main\u nav”id=“nav”parent\u selected\u class=“parent\u selected”selected\u class\u on\u parents=“true”}
{/if}
谢谢。您的源代码似乎有花哨的引用:
{if country_code == “fr”} {/if}
{if country_code == "fr"} {/if}
看到区别了吗?请尝试第二行。您需要确保遵守目录列表规则,并已创建所有目录以及匹配的文件夹和规则 将代码更改为:
<h2 class="title">{if country_code= "fr"} Bonjour !{/if}</h2>
{if country_code=“fr”}你好!{/if}
注意,引号是“and not”和no double==在您的情况下,我可能会使用比有条件的if更好的引号。我回答。请标记我的答案。OP尚不能接受答案。谢谢,但代码更改没有帮助,我已在帖子中添加了全部代码,可能还有其他错误?抱歉,我已删除了我网站上的if标记,使其正常工作,但现在已将其编辑回帖子中。在肚脐周围谢谢但我想卷发是我在没有代码按钮的情况下把它放进去的
<h2 class="title">{if country_code= "fr"} Bonjour !{/if}</h2>