2

所以我试图让我的表达式引擎博客上的类别过滤器在点击一个类别时保持在相同的布局中......但是每次我点击一个类别时,它都会让我跳到一个空白的白色页面(所以看起来它由于某种原因没有从任何地方获得任何样式)。这很奇怪,因为我的标题包含在我所有的样式中,等等。

我有我的初始模板组:“PAGE-COMPS”(带两个模板):

(1) 索引

(2)博客——内容如下

{embed="embeds/header-inner" my_body_class="blog" my_page_title="Blog"} 

  <div class="mid-wrapper">

    <div class="row blog">

      <div class="span9">  
    {embed="posts/index"}
      </div>

  <div class="span2">
     {snp_blog_sidebar}
      </div>

    </div><!-- end of row -->

  </div> <!-- end of mid-wrapper -->

{snp_footer}

然后我有了我的第二个模板组:“嵌入”

我有我的头文件:“头文件内部”在代码上方的文件中看到如下:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>{site_name} | {embed:my_page_title}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

<!-- Le styles -->
<link href="../assets/css/bootstrap.css" rel="stylesheet">
<link href="../assets/css/bootstrap-responsive.css" rel="stylesheet">

<!-- Carousel jscrollpane Styles -->
<link rel="stylesheet" type="text/css" href="../assets/css/jquery.jscrollpane.css" media="all" />

<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

<!-- Load jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>

<!-- Load ScrollTo -->
<script type="text/javascript" src="http://flesler-plugins.googlecode.com/files/jquery.scrollTo-1.4.3.1-min.js"></script>
<!-- Load LocalScroll -->
<script type="text/javascript" src="http://flesler-plugins.googlecode.com/files/jquery.localscroll-1.2.7-min.js"></script>

<script type="text/javascript">// <![CDATA[
    // When the document is loaded...
    $(document).ready(function()
    {
        // Scroll the whole document
        $('#section-links').localScroll({
           target:'body'
        });

    });

// ]]>
</script>

</head>

<body class="{embed:my_body_class}">

<header>

</header>

<div class="container">

  <div class="hero-unit">
    <img class="the" src="../assets/img/the.png">
    <p><a class="logo" href="{site_url}">Site Name<span> More Name</span><img class="image" src="{site_url}assets/img/image.png" alt="{site_name}"></a></p>

    <nav id="section-links">
  <a href="{site_url}">Return to the Home Page</a>
    </nav>
  </div>

  <!-- Main hero unit for a primary marketing message or call to action -->
  <div class="hero-unit">

    <div class="slogan">
      <h1>blog name</h1>
      <p>more description...</p>
    </div>

  </div>

然后我有一个博客条目的最后一个模板组:称为“帖子”

帖子有一个模板:

“索引”如下:

<!-- posts list -->
            <div id="posts-list" class="cf">  

        <!-- THIS ONLY KICKS IN WHEN CATEGORY IS SELECTED (CATEGORY MODE) -->
        {exp:channel:category_heading}
            <h1>{category_name}</h1>
                {if category_description}
            <p>{category_description}</p>
                {/if}
        {/exp:channel:category_heading}

            {exp:channel:entries channel="blog_audio|blog_video|blog_link|blog_quote|blog_post|blog_image" limit="10"}  

            {!-- Choose appropriate snippet based on source channel --}
                {if channel_short_name == "blog_audio"}
                {snp_blog_audio}
            {/if}

            {if channel_short_name == "blog_video"}
                    {snp_blog_video}
            {/if}

                {if channel_short_name == "blog_link"}
                    {snp_blog_link}
                {/if}

            {if channel_short_name == "blog_quote"}
                {snp_blog_quote}
            {/if}

            {if channel_short_name == "blog_post"}
                {snp_blog_post}             
            {/if}

            {if channel_short_name == "blog_image"}
                {snp_blog_image}
            {/if}

            {!-- Commenting out for now, we'll come back to it 
                <!-- page-navigation -->
                <div class="page-navigation cf">
                    <div class="nav-next"><a href="#">&#8592; Older Entries </a></div>
                    <div class="nav-previous"><a href="#">Newer Entries &#8594;</a></div>
                </div>
                <!--ENDS page-navigation -->
            --}

        {/exp:channel:entries}

    </div>
    <!-- ENDS posts list -->

最后,我的侧边栏有一个片段,其类别如下:

SNP_BLOG_SIDEBAR

<!-- sidebar -->
<aside id="sidebar">    
<ul>
    <li class="block">
        <h4>Our Blog</h4>
        Description of our blog goes here
    </li>

    <li class="block">
        <h4>Categories</h4>
        <ul>
            {exp:channel:categories channel="blog_audio|blog_video|blog_link|blog_quote|blog_post|blog_image" style="linear" show_empty="no"}
                <li class="cat-item"><a href="{path='blog/index'}" title="{category_name}">{category_name}</a></li>
            {/exp:channel:categories}
        </ul>
    </li>

    <li class="block">
        <h4>Archives</h4>
        <ul>
            {exp:channel:month_links channel="blog_audio|blog_video|blog_link|blog_quote|blog_post|blog_image" limit="50"}
                <li class="cat-item"><a href="{path='blog/index'}" title="title"> {month}, {year}</a></li>
            {/exp:channel:month_links}
        </ul>
    </li>
</ul>   
</aside>
<!-- ENDS sidebar -->

我非常感谢任何关于可能出现问题的帮助...当我再次单击一个类别时,它会将我带到一个空白白页,其中列出了该类别的博客文章,而不是让我继续关注当前的博客设计...

万分感谢!

4

1 回答 1

1

它是../assets/[...]您的样式的相对链接embeds/header-inner。这可以从http://localhost/index.php/whatever/you-want/或 从工作http://localhost/blog,但不能从任何看起来像浏览器的更深的文件夹结构(http://localhost/blog/categories/[something])那样不起作用。

如果可以的话,从站点根目录尝试一些东西,比如<link rel="stylesheet" href="/assets/css/file.css">.

于 2012-09-08T04:30:11.653 回答