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.

Template is blank if categories are specified

August 05, 2010 8:00am

Subscribe [5]
  • #1 / Aug 05, 2010 8:00am

    (Running 1.6.9)

    I’ve got an odd one…

    A template for a client is calling their projects, I am using a category of ‘Current’ and ‘Archive’ for this section as they needed to pick and choose which entries were current or not (sometimes they need to move an archive project into current.)

    The archive template WAS working but now it seems to have stopped. It just returns a blank page, I’ve got debugging turned on and it’s showing nothing at all, looked at the source code and it is completely blank. When the ‘category=“4”’ bit is removed it shows all of the ‘Projects’ entries without issue. The page that shows the ‘Current’ work, which is very similar in construction is working fine.

    My template structure is as follows:

    /projects/index
    /projects/archive
    /projects/project

    The ‘Projects’ weblog is set to use the path /projects/ and the comments url is set to projects/project (this usually works for me).

    I am using .htaccess to remove /index.php/ and this is functioning normally on all other pages.

    I can’t see what could be causing this. My only thought is that once a second segment appears in the URL, it breaks for some reason.

    Any help is appreciated.

  • #2 / Aug 05, 2010 5:15pm

    Ingmar

    29245 posts

    A template for a client is calling their projects, I am using a category of ‘Current’ and ‘Archive’ for this section as they needed to pick and choose which entries were current or not (sometimes they need to move an archive project into current.)

    Wouldn’t a custom status work equally well for that purpose?

    When the ‘category=“4”’ bit is removed it shows all of the ‘Projects’ entries without issue. The page that shows the ‘Current’ work, which is very similar in construction is working fine.

    Can you show us more of your code? Perhaps a link?

  • #3 / Aug 06, 2010 4:44am

    A custom status could work, but the client still needs to sort certain entries by category (i.e. A collection of entries, or sets of pictures.) So they may need to add to these at a later date.

    The code for the template is:

    {embed="includes/html-begin"}
    {embed="includes/header"}
    <div id="content">
    <h1>Project Archive</h1>
    {exp:weblog:entries weblog="projects" limit="12" category="4"}
    <div class="project-thumbnail{switch="|||-end"}">
    <div class="project-thumbnail-image"><a href="http://{comment_url_title_auto_path}" title="{title}">{exp:imgsizer:size image="{image-main}" width="225" height="127" quality="65"  alt="{title}"}</a></div>
    <a href="http://{comment_url_title_auto_path}" title="{title}">{title}</a>
    </div>
    {paginate}<div id="pagination"><a href="/projects/">Back to Projects</a> | Page {current_page} of {total_pages} pages {pagination_links}{/paginate}
    {/exp:weblog:entries}
    </div>
    {embed="includes/html-end"}

    Not sure if anything is wrong here, as I’ve done similar templates before without issue.

  • #4 / Aug 06, 2010 6:41pm

    Brandon Jones

    5500 posts

    Let’s try creating a blank test template with just:

    {exp:weblog:entries weblog="projects" limit="12" category="4"}
    {title}
    {/exp:weblog:entries}

    Does that return anything?

  • #5 / Aug 09, 2010 6:16am

    That returns the titles of 12 entries as expected.

  • #6 / Aug 09, 2010 10:03am

    Design by Front

    106 posts

    Hey Pillory,

    If you feel really stuck, you could try removing the exp:imgsizer code

    {exp:imgsizer:size image="{image-main}" width="225" height="127" quality="65" style="border:0;" alt="{title}"}

    I love this plugin, but it tends to just throw a blank page if it’s not happy about something, at least then you can rule it out 😉

    Best,
    Chuck

  • #7 / Aug 09, 2010 10:13am

    @Design by Front

    That seems to have narrowed it down. The template worked correctly (just without the images, obviously.)

    Not sure what to do now, as I need that plugin for this template. Will have to think on it.

  • #8 / Aug 09, 2010 10:17am

    Sue Crocker

    26054 posts

    At this point, we’ve taken EE out of the equation. Would you like me to move this to CodeShare Corner for additional community support?

  • #9 / Aug 09, 2010 10:18am

    Sue,

    That’d be great, thanks.

  • #10 / Aug 09, 2010 10:34am

    Design by Front

    106 posts

    Glad you’ve narrowed it down 😊

    If you dont get any further help on the Code Share Forum, there’s a couple of things you can try that might fix this problem:

    1) Is “{image-main}” definitely returning an image? Make sure that the image is of a valid file-type and that the file isn’t damaged/corrupt.

    2) Is the folder where ImageSizer stores the cached image files writable? (this folder is usually located at /images/sized/)

    3) Check the Image Sizing preferences at Admin ›  System Preferences ›  Image Resizing Preferences, if you’ve selected GD 2 or ImageMagick etc ensure that the relevant software is installed on your server.

    4) Does the server have enough memory to process the images being resized?

    If it’s a memory issue, you can try editing the code in your .htaccess file:

    php_value post_max_size 16M
    php_value upload_max_filesize 16M
    php_value memory_limit 64M
    php_value max_execution_time 600

    Increase the value if necessary and try reloading the page


    Hope this helps, don’t give up 😊

  • #11 / Aug 09, 2010 5:44pm

    Ingmar

    29245 posts

    Moving as per request.

  • #12 / Aug 10, 2010 4:56am

    Glad you’ve narrowed it down 😊

    If you dont get any further help on the Code Share Forum, there’s a couple of things you can try that might fix this problem:

    1) Is “{image-main}” definitely returning an image? Make sure that the image is of a valid file-type and that the file isn’t damaged/corrupt.

    2) Is the folder where ImageSizer stores the cached image files writable? (this folder is usually located at /images/sized/)

    3) Check the Image Sizing preferences at Admin ›  System Preferences ›  Image Resizing Preferences, if you’ve selected GD 2 or ImageMagick etc ensure that the relevant software is installed on your server.

    4) Does the server have enough memory to process the images being resized?

    If it’s a memory issue, you can try editing the code in your .htaccess file:

    php_value post_max_size 16M
    php_value upload_max_filesize 16M
    php_value memory_limit 64M
    php_value max_execution_time 600

    1. “{image-main}” definitely works as several other templates are using it and it seemingly has no issues.
    2. The folder is OK permissions-wise, as per point 1, it works on other pages.
    3. This seems OK to me, can’t see anything amiss.
    4. I will check this out, I need to check with the hosts as well as they aren’t my normal provider (the unfamiliarity, which may be one of the issues.)

  • #13 / Aug 19, 2010 9:28am

    A small development, it seems there is more to this than I first thought.

    I’ve moved from using categories to weblogs for the archive (e.g. ‘projects-archive’), which will allow for more flexibility in the long-run.

    But the blank template problem persists, it seems if more than one entry is put into the ‘projects-archive’ it starts showing as a blank template (nothing in the source code either.)

    I continue to investigate, but I’m lost as to what this is doing.

    EDIT: Correction, it isn’t if only a single entry is moved over. I tried ‘limit=“2”’ the template still works. All the way up to five entries, then nothing again.

  • #14 / Aug 19, 2010 10:31am

    Design by Front

    106 posts

    Sorry to hear this is still causing you trouble :(

    I’m intrigued that you have decided to use a new weblog for archiving your entries, wouldnt it be easier to create a custom status as Ingmar suggested?

    Anyway, back on topic, so you are able to set limit=“5” but not limit=“6” correct? In that case, can you identify what the sixth entry is and check to see if there’s anything different/unusual about it, paying special attention to any custom fields that use extensions/plugins (e.g. Image Sizer).

    I would also suggest at this point that you repeat Brandon Jones’s suggestion of only outputting the {title} tag to see if that works for you. Then add each of your custom field tags back in on-by-one, reloading the page each time, until the page breaks again.

    If all signs still point to the Image Sizer plugin, i’m not sure what else I can advise you to try except perhaps seeking an alternative plugin? I hope somebody can help you 😊

  • #15 / Aug 19, 2010 12:12pm

    A custom status could work, but there was a flexibility issue with regard to how the client wants this section to work which made using a separate weblog more suited at this time.

    I can set the limit to ‘4’, anything above this and the template renders as a blank page (no source code, etc.) Having done what you suggested and checked the entry that would have been fifth, I altered something and submitted it which seems to enabled me to go to ‘8’ as a limit. The pagination seems to have a problem with something beyond entry ‘9’ or more now as it is doing the same thing again (I’ve tried editing the entries beyond the eighth entry, but it hasn’t had the same effect.

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

ExpressionEngine News!

#eecms, #events, #releases