我使用CMSMS建立了一个网站。我在检索元标记时遇到了麻烦。我认为这需要在header.inc.php文件中完成。到目前为止,内容的元标记为空。
<meta name="description" content="">
根据我在网上发现的一些文档,我需要把它们放在
<meta name="description" content="{content}">
但是只是从字面上在标记中输出。什么是正确的方法?
<meta name="description" content="{$content}">
<meta name="description" content={content}>
<meta name="description" content="<?php $content ?>">
<meta name="description" content="<?php echo $content ?>">
以及{keywords}呢?
没有这些工作。
您不需要触摸header.inc.php,您使用的是CMS Made Simple,而不是让CMS变得困难:)。
转到“网站管理员>设置-全局设置>常规设置选项卡>全局元数据”,在其中添加所有标签,并将smarty标签{元数据}放在页面模板中。
此处有更多详细信息:https://docs.cmsmadesimple.org/configuration/global-settings
希望有帮助。 PS在Slack频道上也有很多快速建议。