【问题标题】:how do I order the output of the head tags in joomla 3?如何在 joomla 3 中订购头部标签的输出?
【发布时间】:2014-07-10 23:08:52
【问题描述】:

我在 joomla 3 中安装了一个插件,它在页面头部添加了 og: 标签,以及一些手动放置自己的 javascript 库和 css 文件的其他组件。

位置对我来说是随机发生的,因为我无法订购它们。

我需要将 og 标记放在 javascript 代码上方。

那么我如何对 head 标签的输出进行排序呢?有可能吗?

例如:

<head>
 <meta name="viewport" content="width=device-width, initial-scale=1">
  <base href="http://websiteurl.com" />
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="keywords" content="some keywords" />
  <meta name="author" content="Super User" />
  <meta name="description" content="somedescription" />
  <meta name="generator" content="Joomla! - Open Source Content Management" />
  <title>Κεντρική</title>
  <link href="http://websiteurl.com" rel="canonical" />
  <link href="/templates/websiteurl/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
  <link href="http://websiteurl.com/el/component/search/?format=opensearch" rel="search" title="Αναζήτηση fmagreece.com" type="application/opensearchdescription+xml" />
  <link rel="stylesheet" href="http://websiteurl.com/plugins/content/socialsharebuttons/style/style.css" type="text/css" />
  <link rel="stylesheet" href="http://websiteurl.com/plugins/system/shadowbox/shadowbox/examples/build/shadowbox.css" type="text/css" />
  <link rel="stylesheet" href="/media/jui/css/bootstrap.min.css" type="text/css" />
  <link rel="stylesheet" href="/media/jui/css/bootstrap-responsive.min.css" type="text/css" />
  <link rel="stylesheet" href="/media/jui/css/bootstrap-extended.css" type="text/css" />
  <link rel="stylesheet" href="/media/mod_languages/css/template.css" type="text/css" />
  <link rel="stylesheet" href="/modules/mod_ariextmenu/mod_ariextmenu/js/css/menu.min.css" type="text/css" />

  <meta property='og:url' content='http://fmabrotherhood.com/el/'>
  <meta property='og:type' content='article'>
  <meta property='og:title' content='main '>
  <meta property='og:description' content='some description'>
  <meta property='og:image' content='http://websiteurl.com/images/welcomeswstows.jpg'>

<link href="/templates/fmafilipinomartialartstemplate/css/template.css" rel="stylesheet" type="text/css" />
</head>     

把它改成

<head>    
  <meta property='og:url' content='http://fmabrotherhood.com/el/'>
  <meta property='og:type' content='article'>
  <meta property='og:title' content='main '>
  <meta property='og:description' content='some description'>
  <meta property='og:image' content='http://websiteurl.com/images/welcomeswstows.jpg'>

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <base href="http://websiteurl.com" />
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <meta name="keywords" content="some keywords" />
  <meta name="author" content="Super User" />
  <meta name="description" content="somedescription" />
  <meta name="generator" content="Joomla! - Open Source Content Management" />
  <title>Κεντρική</title>
  <link href="http://websiteurl.com" rel="canonical" />
  <link href="/templates/websiteurl/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
  <link href="http://websiteurl.com/el/component/search/?format=opensearch" rel="search" title="Αναζήτηση fmagreece.com" type="application/opensearchdescription+xml" />
  <link rel="stylesheet" href="http://websiteurl.com/plugins/content/socialsharebuttons/style/style.css" type="text/css" />
  <link rel="stylesheet" href="http://websiteurl.com/plugins/system/shadowbox/shadowbox/examples/build/shadowbox.css" type="text/css" />
  <link rel="stylesheet" href="/media/jui/css/bootstrap.min.css" type="text/css" />
  <link rel="stylesheet" href="/media/jui/css/bootstrap-responsive.min.css" type="text/css" />
  <link rel="stylesheet" href="/media/jui/css/bootstrap-extended.css" type="text/css" />
  <link rel="stylesheet" href="/media/mod_languages/css/template.css" type="text/css" />
  <link rel="stylesheet" href="/modules/mod_ariextmenu/mod_ariextmenu/js/css/menu.min.css" type="text/css" />

<link href="/templates/fmafilipinomartialartstemplate/css/template.css" rel="stylesheet" type="text/css" />
</head>

【问题讨论】:

    标签: joomla joomla3.0


    【解决方案1】:

    您很可能需要编辑插件。一般像这样的简单插件只是在页面渲染之前搜索并替换一段html。

    例如,我看了这个.... http://extensions.joomla.org/extensions/site-management/seo-a-metadata/open-graph/17810

    这会查找标签&lt;/title&gt; 并将OG 内容放在其后。您的可能会以类似的方式工作。

    不过,可以肯定的是,Facebook 不介意您将标签放在头部的哪个位置。

    【讨论】:

      猜你喜欢
      • 2013-12-07
      • 1970-01-01
      • 2016-02-17
      • 2020-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-05
      相关资源
      最近更新 更多