Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は現在、WHMCSの1つのテンプレートを編集しています。これは、Smartyによって作成されています。
次のような単純なものを使用できますか
{if $is_homepage} show something {/if}
どのホームページがhomepage.tplからロードされるか、平均インデックスページ。コードをロードしたいので、ホームページだけに。ありがとう。
かなりハッキーですが、次のようなことを試してみてください。
{if ($smarty.server.SCRIPT_NAME eq "/index.php")} {/if}
最適化されたコードが必要な場合は、代わりにこれを使用してください。
{if $filename eq "index"} your code here {/if}
.tplのようなファイル名拡張子を含める必要はありません(疑問に思った場合に備えて)