ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

All entries displayed for each category

June 26, 2007 1:31pm

Subscribe [1]
  • #1 / Jun 26, 2007 1:31pm

    Daman

    10 posts

    Hi , I have created a few categories on my blog and assigned articles to each.
    I have a index template which embeds a left_section template. The left_section template displays the category links.

    The issue I am facing is that clicking on any of the category links displays all entries instead of displaying the entries for that category only.

    Below are code snippets for the index and left_section templates. Not sure what I am doing wrong.

    
    
    


    left_section template

    
    									
  • #2 / Jun 26, 2007 2:54pm

    Lisa Wess

    20502 posts

    Hi, Damn!

    A few questions:

    1) What version and build are you on?
    2) Are you using category names in links, or IDs?
    3) Can you provide a link to the site so we can see this in action?

  • #3 / Jun 26, 2007 3:02pm

    Daman

    10 posts

    Hi Lisa,

    -version: 1.5.2, Build:20070302
    -Using ID’s
    -The blog is still internal , so unfortunately can’t send a link.

    Another thing though, the same templates work correctly on another windows machine…So I am thinking if it could have something to do with PHP build on this machine?

    Thanks
    -Daman

  • #4 / Jun 26, 2007 3:32pm

    Lisa Wess

    20502 posts

    Can you tell me the link, everything the domain.  Ie: index.php/???/??? etc?  Include the index.php for me in this case please.

  • #5 / Jun 26, 2007 10:31pm

    Daman

    10 posts

    I am not sure if I got your question right…so please let me know if I am completely out of line here 😊

    The url for index template is

    <a href="http://new.fmr.com:90/ee/index.php/jurrienblog/index">http://new.fmr.com:90/ee/index.php/jurrienblog/index</a>

    The url for various category links are

    <a href="http://new.fmr.com:90/ee/index.php/jurrienblog/C1/">http://new.fmr.com:90/ee/index.php/jurrienblog/C1/</a>
    <a href="http://new.fmr.com:90/ee/index.php/jurrienblog/C2/">http://new.fmr.com:90/ee/index.php/jurrienblog/C2/</a>
    .........etc

    Below is the code from index.php.

    <?php
    /*
    =====================================================
     ExpressionEngine - by pMachine
    -----------------------------------------------------
     <a href="http://www.pmachine.com/">http://www.pmachine.com/</a>
    -----------------------------------------------------
     Copyright (c) 2003 - 2007 pMachine, Inc.
    =====================================================
     THIS IS COPYRIGHTED SOFTWARE
     PLEASE READ THE LICENSE AGREEMENT
     <a href="http://eedocs.pmachine.com/license.html">http://eedocs.pmachine.com/license.html</a>
    =====================================================
     File: index.php
    -----------------------------------------------------
     Purpose: Triggers the main engine
    =====================================================
    */
    
    // URI Type
    // This variable allows you to hard-code the URI type.
    // For most servers, 0 works fine.
    // 0 = auto  
    // 1 = path_info  
    // 2 = query_string
    
    $qtype = 0; 
    
    
    // DO NOT EDIT BELOW THIS!!! 
    
    error_reporting(0);
    
    if (isset($_GET['URL'])) 
    { 
        /** ---------------------------------
        /**  URL Redirect for CP and Links in Comments
        /** ---------------------------------*/
    
        $_GET['URL'] = str_replace(array("\r", "\r\n", "\n", ':',':','/','/'), 
                                   array('', '', '', ':', ':', '/', '/'), 
                                   $_GET['URL']);
        
        if (substr($_GET['URL'], 0, 4) != "http" AND ! ereg('://', $_GET['URL'])) 
            $_GET['URL'] = "http://".$_GET['URL']; 
            
        $_GET['URL'] = str_replace( array('"', "'", ')', '(', ';', '}', '{', 'script%', 'script&', '(', ')'), 
                                    '', 
                                    strip_tags($_GET['URL']));
        
        $host = ( ! isset($_SERVER['HTTP_HOST'])) ? '' : $_SERVER['HTTP_HOST'];
        
        if ( ! isset($_SERVER['HTTP_REFERER']) OR ! stristr($_SERVER['HTTP_REFERER'], $host))
        {
            // Possibly not from our site, so we give the user the option
            // Of clicking the link or not
            
            $str = "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>".
                    "To proceed to the URL you have requested, click the link below:".
                    "<a href="http://.$_GET">".$_GET['URL']."</a>\n</body>\n</html>";
        }
        else
        {
            $str = "<html>\n<head>\n<title>Redirect</title>\n".
                   '<meta http-equiv="refresh" content="0; URL='.$_GET['URL'].'">'.
                   "\n</head>\n<body>\n</body>\n</html>";
        }
        
        exit($str);
    }
    
    $uri  = '';
    $pathinfo = pathinfo(__FILE__);
    $ext  = ( ! isset($pathinfo['extension'])) ? '.php' : '.'.$pathinfo['extension'];
    $self = ( ! isset($pathinfo['basename'])) ? 'index'.$ext : $pathinfo['basename'];
    
    $path_info = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
    $query_str = (isset($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : @getenv('QUERY_STRING');
    
    switch ($qtype)
    {
        case 0 :    $uri = ($path_info != '' AND $path_info != "/".$self) ? $path_info : $query_str;
            break;
        case 1 :    $uri = $path_info;     
            break;
        case 2 :    $uri = $query_str; 
            break;
    }
    
    unset($system_path);
    unset($config_file);
    unset($path_info);
    unset($query_str);
    unset($qstr);
    
    require 'path'.$ext;
    
    if ((isset($template_group) AND isset($template)) && $uri != '' && $uri != '/')
    {
        $template_group = '';
        $template = '';
    }
    
    if ( ! isset($system_path))
    {
        if (file_exists('install'.$ext))
        {
            header("location: install".$ext); 
            exit;
        }
        else
        {
            exit("The system does not appear to be installed. Click <a href="http://install.php">here</a> to install it.");    
        }
    }
    
    if ( ! ereg("/$", $system_path)) $system_path .= '/';
    
    if ( ! @include($system_path.'core/core.system'.$ext))
    {
        exit("The system path does not appear to be set correctly.  Please open your path.php file and correct the path.");    
    }
    
    ?>

    Thanks

  • #6 / Jul 02, 2007 4:17pm

    Daman

    10 posts

    Finally, I did get this to work

    Changing the following line in my index template did the trick. Basically had to remove the category_group parameter. Have no idea why that worked because the category group for this blog does have an id of 2.

    {exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="10"
     rdf="off" paginate="bottom" disable="member_data|trackbacks" category_group="2"}

    to

    {exp:weblog:entries weblog="{my_weblog}" orderby="date" sort="desc" limit="10"
     rdf="off" paginate="bottom" disable="member_data|trackbacks"}
  • #7 / Jul 02, 2007 4:19pm

    Lisa Wess

    20502 posts

    Glad you got that sorted out, Daman. Thank you for posting the solution!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases