0

簡単な質問をお願いします。

私はJoomlaを使用しています!2.5.8。eCSSentialを発見したばかりで、index.phpで次のコードを使用しています

    <script>
    <!-- Add eCSSential.min.js inline here -->

    eCSSential({
        "all": "css/all.css",
        "(min-width: 20em)": "css/min-20em.css",
        "(min-width: 37.5em)": "css/min-37.5em.css",
        "(min-width: 50em)": "css/min-50em.css",
        "(min-width: 62.5em)": "css/min-62.5em.css"
    });
 </script>

今、私のJoomla!ファイル私はこれを持っています...

<script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/js/eCSSential.js"></script>


<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/style.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 1024px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-1024.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 768px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-758.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 524px)" href="<?php echo $this->baseurl ?>/templates/nameoftemplate/css/max-width-524.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/css/lightbox.css"  type="text/css" />

Joomla!で機能するように、スクリプトの括弧内にファイルパスを書き込む方法がよくわかりません。使用されている例は、私が推測する通常のディレクトリ構造です。いくつかの組み合わせを試しましたが、サイトのスタイルが設定されていないため、何も機能しません...

誰かが助けてくれることを願っています!

4

3 に答える 3

0

次のことを試してください。いくつかの小さな調整が行われました。

<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/js/eCSSential.js"></script>


<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/style.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 1024px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-1024.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 768px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-758.css" type="text/css" />
<link rel="stylesheet" media="screen and (max-width: 524px)" href="<?php echo $this->baseurl; ?>/templates/nameoftemplate/css/max-width-524.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/lightbox.css" type="text/css" />
于 2012-12-05T14:21:11.733 に答える
0

動的テンプレート ディレクトリを使用する理由 切り替えない限り、代わりにテンプレート名を書くだけです

<?php echo $this->template?>.

于 2012-12-05T14:13:41.953 に答える
0

テンプレートのフォルダ名が正しいことを確認してください。

その後、次の方法でアクセスできます。

<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/style.css" rel="stylesheet" type="text/css" />

or

<link href="<?php echo JURI::root(); ?>templates/<?php echo $this->template; ?>/css/style.css" rel="stylesheet" type="text/css" />

or

<link href="<?php echo JURI::root(); ?>templates/name of the template_folder/css/style.css" rel="stylesheet" type="text/css" />

この場合、結果を修正します。そうしないと、index.php のレンダリングに問題があります。デフォルトのテンプレートをチェックして、正常に機能することを確認してください。

于 2012-12-05T15:18:14.930 に答える