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.

PHP controlled template not outputting any content

November 08, 2007 6:16pm

Subscribe [3]
  • #1 / Nov 08, 2007 6:16pm

    AngMed

    71 posts

    I have a similar problem. We have over the years used various solution for our websites to be on one EE installation. For some months ago, we bought the MSM so we could move some sites into MSM system so we can be able to use more of the EE capabilities/functionaries on one installation. All our websites are on one dedicated server.
    After setting up the new website using MSM, duplicated the templates only (so i still had all a backup), following the instruction, putting the path.php and index.php file under the new site, I first got a blank page as stonemonkey45 described and after changing index.php:

    error_reporting(0);

    with:

    error_reporting(E_ALL);
    ini_set('display_errors', 1);

    I got this error message:

    Notice: Undefined variable: remove_unparsed_variables in /home/angmed/public_html/system/core/core.output.php on line 295

    The website url: christianity.net.au

    Info in the path.php should be ok:

    <?php
    
    // DO NOT ALTER THIS FILE UNLESS YOU HAVE A REASON TO
    
    
    $system_path = "/home/angmed/public_html/system/";
    $site_name = 'christianity';
    
    $template_group = "";
    $template = "";
    $site_url = "";
    $site_index = "";
    
    ?>

    Im on the latest EE built: 20070918 and the latest MSM (updated yesterday)

  • #2 / Nov 08, 2007 6:40pm

    Derek Jones

    7561 posts

    Well that’s a funny little bug that’s never been detected, since having your debugging settings set to 0 would normally prevent that error from being displayed.  I’ve fixed this for the next release, but you can fix this now by changing your debugging setting to ‘1’ (errors shown to super admins) or going to the indicated line number in core.output.php and changing $remove_unparsed_variables to $this->remove_unparsed_variables.

  • #3 / Nov 08, 2007 7:14pm

    AngMed

    71 posts

    The debugging setting is now set to ‘1’ and this error message doesnt appear. My problem is that nothing appear, just blank page (christianity.net.au).
    Im not sure what i have done wrong. Shouldnt the site been working now?, since the path.php gives the correct info about system path and site name.

  • #4 / Nov 08, 2007 7:16pm

    Derek Jones

    7561 posts

    Do you have a template group created for this site, and a template defined as the site’s default index template?

  • #5 / Nov 08, 2007 8:36pm

    AngMed

    71 posts

    I have added the template_group and template in the path.php

    I also went into the template and ticked off ‘Make the index template in this group your site’s home page?’

    This is the change in path.php:

    <?php
    
    $system_path = "/home/angmed/public_html/system/";
    $site_name = 'christianity';
    
    $template_group = "cnet";
    $template = "index";
    $site_url = "";
    $site_index = "";
    
    ?>

    Still just a blank page.

  • #6 / Nov 08, 2007 8:43pm

    Derek Jones

    7561 posts

    The template group and template variables aren’t necessary unless you want that to override the ‘Make the index template in this group your site’s home page?’ setting.  Is there anything in the cnet/index template?  Copy its contents here, please.

  • #7 / Nov 08, 2007 9:02pm

    AngMed

    71 posts

    I checked using FTP to check if the files under system/template_files/cnet actually are there.

    This is the cnet/index:

    <?
    /////////////////
    // index
    ////////////////
    
    $template_dir = "/home/angmed/public_html/system/template_files/cnet";
    
    $segment_1 = "{segment_1}";
    $segment_2 = "{segment_2}";
    $segment_3 = "{segment_3}";
    $segment_4 = "{segment_4}";
    
    // -------------------------
    // Header
    // -------------------------
    include("$template_dir/common-header.php");
    
    // -------------------------
    // Content
    // -------------------------
    
    switch ($segment_2) {
    
    // index/home page
    case "" :
    include("$template_dir/index-content.php");
    break;
     
        // god section
        case "god" :
            
              switch ($segment_3) {        
              // god index
                case "" :
                include("$template_dir/god-index.php");
                break;
              // god whose
                case "god-whose" :
                include("$template_dir/god-whose.php");
                break;        
              // god christ
                case "god-christ" :
                include("$template_dir/god-christ.php");
                break;
              // god healer
                case "god-healer" :
                include("$template_dir/god-healer.php");
                break;
              // god teacher
                case "god-teacher" :
                include("$template_dir/god-teacher.php");
                break;
              // god saviour
                case "god-saviour" :
                include("$template_dir/god-saviour.php");
                break;
              // god lord
                case "god-lord" :
                include("$template_dir/god-lord.php");
                break;
              // god epilogue
                case "god-epilogue" :
                include("$template_dir/god-epilogue.php");
                break;
              // god entry
                default :
                echo "god entry";
                break;
                }
            
        break;
        
        // you secton
        case "you" :
            
              switch ($segment_3) {        
              // you index
                case "" :
              include("$template_dir/you-index.php");
                break;
                // you entry
                default :
              include("$template_dir/you-entry.php");
                break;
                }        
    
        break;
    
        // feature section
        case "feature" :
            
              switch ($segment_3) {        
              // feature index
                case "" :
              include("$template_dir/feature-index.php");
                break;
                // feature entry
                default :
              include("$template_dir/feature-entry.php");
                break;
                }        
    
        break;
    
        // blog section
        case "blog" :
            
              switch ($segment_3) {        
              // blog index
                case "" :
              include("$template_dir/blog-index.php");
                break;
            // blog entry
                default :
              include("$template_dir/blog-entry.php");
                break;
                }        
    
        break;
    
        // blog author section
        case "blog-author" :
            
              switch ($segment_3) {        
              // feature index
                case "" :
              include("$template_dir/blog-author-index.php");
                break;
                // feature entry
                default :
              include("$template_dir/blog-author-entry.php");
                break;
                }        
    
        break;
    
        // questions secton
        case "questions" :
            
              switch ($segment_3) {        
              // questions index
                case "" :
              include("$template_dir/questions-index.php");
                break;
             // questions category
                case "questions-cat" :
              include("$template_dir/questions-cat.php");
                break;
              // questions results
                case "questions-results" :
              include("$template_dir/questions-results.php");
                break;
              // questions noresults
                case "questions-noresults" :
              include("$template_dir/questions-noresults.php");
                break;
                // questions entry
                default :
              include("$template_dir/questions-entry.php");
                break;
                }        
    
        break;
    
        
        // world secton
        case "world" :
    
              switch ($segment_3) {        
              // world index
                case "" :
              include("$template_dir/world-index.php");
                break;
                // world entry
                default :
              include("$template_dir/world-entry.php");
                break;
                }        
    
        break;
    
        // about_us secton
        case "about_us" :
              switch ($segment_3) {    
                case "" :
              include("$template_dir/about_us.php");
                break;    
                default :
                           include("$template_dir/about_us.php");
                             break;
                    }
    
    
        break;
    
        // downloads secton
        case "downloads" :
              switch ($segment_3) {    
                case "" :
              include("$template_dir/downloads.php");
                break;    
                default :
                           include("$template_dir/downloads.php");
                             break;
                    }
    
    
        break;
      
      
    }
    
    // -------------------------
    // Footer
    // -------------------------
    include("$template_dir/common-footer.php");
    
    ?>
  • #8 / Nov 08, 2007 9:05pm

    Derek Jones

    7561 posts

    Check in the Template Editor.  If you are saving templates as files and do not have the full server path setup properly to your template directory, or if permissions are set incorrectly, then ExpressionEngine will not be able to read the files.  You’ll be able to tell because the template will not have any content in the template editor. (or it will be out of date)

  • #9 / Nov 08, 2007 9:07pm

    Derek Jones

    7561 posts

    Oh, and when you say that you duplicated the templates, did you use the MSM site creation tool to handle this or did you do it manually?

  • #10 / Nov 08, 2007 9:13pm

    AngMed

    71 posts

    i used the MSM to do it.

  • #11 / Nov 08, 2007 9:28pm

    AngMed

    71 posts

    I have save every template as a file and in the index file I have given the full server (path to /cnet template group (/home/angmed/public_html/system/template_files/cnet). Im not sure about permission…
    I can PM you our CP details if you want to have a quick look?

  • #12 / Nov 08, 2007 11:52pm

    Derek Jones

    7561 posts

    Before you do that, can you answer whether or not anything shows up in the template editor for this template?

  • #13 / Nov 09, 2007 12:00am

    AngMed

    71 posts

    Hi,
    When I go to
    christianity.net.au ›  Templates ›  Edit Template (cnet/index)
    I get the correct template:

    <?
    /////////////////
    // index
    ////////////////
    
    $template_dir = "/home/angmed/public_html/system/template_files/cnet";
    
    $segment_1 = "{segment_1}";
    $segment_2 = "{segment_2}";
    $segment_3 = "{segment_3}";
    $segment_4 = "{segment_4}";
    
    // -------------------------
    // Header
    // -------------------------
    include("$template_dir/common-header.php");
    
    // -------------------------
    // Content
    // -------------------------
    
    switch ($segment_2) {
    
    // index/home page
    case "" :
    include("$template_dir/index-content.php");
    break;
     
        // god section
        case "god" :
            
              switch ($segment_3) {        
              // god index
                case "" :
                include("$template_dir/god-index.php");
                break;
              // god whose
                case "god-whose" :
                include("$template_dir/god-whose.php");
                break;        
              // god christ
                case "god-christ" :
                include("$template_dir/god-christ.php");
                break;
              // god healer
                case "god-healer" :
                include("$template_dir/god-healer.php");
                break;
              // god teacher
                case "god-teacher" :
                include("$template_dir/god-teacher.php");
                break;
              // god saviour
                case "god-saviour" :
                include("$template_dir/god-saviour.php");
                break;
              // god lord
                case "god-lord" :
                include("$template_dir/god-lord.php");
                break;
              // god epilogue
                case "god-epilogue" :
                include("$template_dir/god-epilogue.php");
                break;
              // god entry
                default :
                echo "god entry";
                break;
                }
            
        break;
        
        // you secton
        case "you" :
            
              switch ($segment_3) {        
              // you index
                case "" :
              include("$template_dir/you-index.php");
                break;
                // you entry
                default :
              include("$template_dir/you-entry.php");
                break;
                }        
    
        break;
    
        // feature section
        case "feature" :
            
              switch ($segment_3) {        
              // feature index
                case "" :
              include("$template_dir/feature-index.php");
                break;
                // feature entry
                default :
              include("$template_dir/feature-entry.php");
                break;
                }        
    
        break;
    
        // blog section
        case "blog" :
            
              switch ($segment_3) {        
              // blog index
                case "" :
              include("$template_dir/blog-index.php");
                break;
            // blog entry
                default :
              include("$template_dir/blog-entry.php");
                break;
                }        
    
        break;
    
        // blog author section
        case "blog-author" :
            
              switch ($segment_3) {        
              // feature index
                case "" :
              include("$template_dir/blog-author-index.php");
                break;
                // feature entry
                default :
              include("$template_dir/blog-author-entry.php");
                break;
                }        
    
        break;
    
        // questions secton
        case "questions" :
            
              switch ($segment_3) {        
              // questions index
                case "" :
              include("$template_dir/questions-index.php");
                break;
             // questions category
                case "questions-cat" :
              include("$template_dir/questions-cat.php");
                break;
              // questions results
                case "questions-results" :
              include("$template_dir/questions-results.php");
                break;
              // questions noresults
                case "questions-noresults" :
              include("$template_dir/questions-noresults.php");
                break;
                // questions entry
                default :
              include("$template_dir/questions-entry.php");
                break;
                }        
    
        break;
    
        
        // world secton
        case "world" :
    
              switch ($segment_3) {        
              // world index
                case "" :
              include("$template_dir/world-index.php");
                break;
                // world entry
                default :
              include("$template_dir/world-entry.php");
                break;
                }        
    
        break;
    
        // about_us secton
        case "about_us" :
              switch ($segment_3) {    
                case "" :
              include("$template_dir/about_us.php");
                break;    
                default :
                           include("$template_dir/about_us.php");
                             break;
                    }
    
    
        break;
    
        // downloads secton
        case "downloads" :
              switch ($segment_3) {    
                case "" :
              include("$template_dir/downloads.php");
                break;    
                default :
                           include("$template_dir/downloads.php");
                             break;
                    }
    
    
        break;
      
      
    }
    
    // -------------------------
    // Footer
    // -------------------------
    include("$template_dir/common-footer.php");
    
    ?>
  • #14 / Nov 09, 2007 12:10am

    Derek Jones

    7561 posts

    Ok, I went ahead and looked with the information you gave me.  Your site appears to be working for your regular templates, i.e. http://www.christianity.net.au/index.php/cnet/blog-index/ so the problem must lie in your PHP, and I’m afraid that we cannot help troubleshoot custom PHP solutions.  I am curious, though, why you are using the above setup instead of using ExpressionEngine templates in a normal manner to manage and display your content.  I’m going to go ahead and move this thread to the How To forum, though, since the issue of the PHP error being caused by ExpressionEngine is resolved.

  • #15 / Nov 09, 2007 1:03am

    AngMed

    71 posts

    Good question. I have inherited this site from the previous developer, and he thought it was a lot faster to create new pages with new templates this way.
    I will have to look into how we can solve this. Its quite strange, since it work fine before I moved it into the MSM system.

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

ExpressionEngine News!

#eecms, #events, #releases