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.

File template not rendering image path

October 09, 2011 11:33pm

Subscribe [3]
  • #1 / Oct 09, 2011 11:33pm

    Gernot

    7 posts

    Initially, I was using database templates then switched to file-based templates. The template is set to render an image from /img/picture.png. The directory, img, is one I’ve created under the site root. This works in the database template but not in the file template. When I inspect the image element, it appears to point toward the correct URL. I’ve tried a few things including,

    {site_url}img/picture.png

    . That points to the correct URL as well but again, doesn’t render. I’m guessing this is a permissions issue but don’t understand why the images under the directory are available to a database template and not a file template.

  • #2 / Oct 10, 2011 8:28am

    Sue Crocker

    26054 posts

    Welcome to the ExpressionEngine forums, Gernot.

    When you say file template, what exactly are you referring to? Can you post your template code that goes with this?

    Can you tell us which version/build of EE2.x you’re using? See EEWiki:// HowTo Determine My EE Version

  • #3 / Oct 10, 2011 12:07pm

    Gernot

    7 posts

    I’m referring to the feature “Allow Templates to be Saved as Files?” set in Design->Template Manager->Global Template Preferences. The permissions template directory are set to 777 and appears configured correctly as I can save the template as a file from EE and edits I make to the template are saved to the template accessed through the CP.

    I’m using v2.2.2 - Build: date 2011080

    The template below is cut short as it exceeds the character limit of this forum.

    Here’s the template:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <!--
     ! Excerpted from "Expression Engine 2.0: A Quick Start Guide",
     ! published by The Pragmatic Bookshelf.
     ! Copyrights apply to this code. It may not be used to create training material, 
     ! courses, books, articles, and the like. Contact us if you are in doubt.
     ! We make no guarantees that this code is fit for any purpose. 
     ! Visit <a href="http://www.pragmaticprogrammer.com/titles/riexen">http://www.pragmaticprogrammer.com/titles/riexen</a> for more book information.
    -->
    
    <html xml:lang="en" lang="en">
    <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    
     <title>Engine City Times</title>                                        
     <link rel="stylesheet" href="{stylesheet=site/site_css}" 
     type="text/css" media="screen" />
     <!--[if lt IE 7]>
     <link rel="stylesheet" href="css/screen/patches/win-ie-old.css" type="text/css" media="screen, projection" />
     <![endif]-->
     <!--[if gte IE 7]>
     <link rel="stylesheet" href="css/screen/patches/win-ie7-up.css" type="text/css" media="screen, projection" />
     <![endif]-->
     
    </head>
    
    <body class="home">
     
     <div id="layoutWrapper">
      <div id="masthead">
       <h1>Engine City Times</h1>
       <h2>Monday, March 1, 2010</h2>
    <p>   <br />
       <div id="main-nav"><br />
        <ul><br />
         <li><a href="http://class=current">Home</a></li><br />
         <li><a href="http://">News</a></li><br />
         <li><a href="http://">Sports</a></li><br />
         <li><a href="http://">Politics</a></li><br />
         <li><a href="http://">Obits</a></li><br />
        </ul><br />
        <a href="#">/img/feed-icon.pngSubscribe to the News</a><br />
       </div> <!-- END #main-nav --><br />
      </div> <!-- END #masthead --><br />
      <br />
      <div id="content"><br />
       <div id="top-stories"><br />
        </p><h3>Top Stories</h3>
    <p><div id="lead-article"><br />
    {exp:channel:entries channel="news_articles"<br />
          limit="1"<br />
          disable="pagination"<br />
          status="Featured Top Story"}<br />
     <a href="/img/news-article-image.pngR1vDS6j2vNCTuDeD5SUu31H9GKrF8HGntypography_img_src_end  alt=Image Alt Here ">/img/news-article-image.pngR1vDS6j2vNCTuDeD5SUu31H9GKrF8HGntypography_img_src_end  alt=Image Alt Here </a><br /></p><h4>{title}</h4><h5><span class="by">By</span> {author}</h5>
    <p> {article_excerpt} <br />
     <a href="http://{title_permalink=" class="read_story">Read Story</a><br />
    {/exp:channel:entries}<br />
    </div><!-- END #lead-article --> <br />
         <br />
         <div id="sec-story-left"><br />
         <br />
         {exp:channel:entries channel="news_articles"<br />
               limit="2"<br />
               disable="pagination"<br />
               status="Top Story"}<br />
         <br />
          </p><h4>{title}</h4>
    <p>      </p><h5><span class="by">By</span> {author}</h5>
    <p>      {article_excerpt}<br />
          <a href="http://{title_permalink=" class="read_story">Read Story</a><br />
          <br />
         {/exp:channel:entries}<br />
         </div><!-- END #sec-story-left --><br />
         <br />
         <div id="sec-story-right"><br />
        </p><h4>Duis aute irure dolor</h4>
    <p>    </p><h5><span class="by">By</span> Bob Smith</h5>
    <p>     TEHRAN, May 20 — Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br />
         Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br />
         Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. <br />
         <a href="#" class="read_story">Read Story</a>                          <br />
         </div> <!-- END sec-story-right --><br />
         <div>/div>         <br />
       </div><!-- END #top-stories --><br />
       <div id="to-editor"><br />
        </p><h3>To the Editor</h3>
    <p>    Every day we publish some of your emails, letters and comments.<br />
        <div id="lcol"><br />
        </p><h4>Excepteur sint occaecat</h4>
    <p>    </p><h5><span class="by">From</span> John Doe</h5>
    <p>     Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br />
        </div><br />
        <br />
        <div id="mcol"><br />
        </p><h4>Excepteur sint occaecat</h4>
    <p>    </p><h5><span class="by">From</span> John Doe</h5>
    <p>     Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br />
        </div><br />
        <br />
        <div id="rcol"><br />
        </p><h4>Excepteur sint occaecat</h4>
    <p>    </p><h5><span class="by">From</span> John Doe</h5>
    <p>     Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.<br />
        </div><br />
        <br />
        To submit your letter or comment, you can use our <a href="#">commment form</a> or email <a href="#">[email protected]</a>. Letters may be edited for content, clarity and space constraints.<br />
       </div><br />
       <div>/div><!-- END clear --><br />
       <br />
      </div><!-- END #content --></p>
    
    <p></html>

  • #4 / Oct 10, 2011 6:53pm

    Gernot

    7 posts

    I found the issue. I forgot to include the img directory in my .htaccess.

  • #5 / Oct 11, 2011 12:17am

    Dan Decker

    7338 posts

    Gernot,

    Excellent news! If you ever need assistance in the future, please feel free to start a new thread.

    Cheers!

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

ExpressionEngine News!

#eecms, #events, #releases