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.

Problem with channels

February 01, 2012 5:05pm

Subscribe [2]
  • #1 / Feb 01, 2012 5:05pm

    drinn

    3 posts

    Hello,

    I have a little problem regarding Channels.

    The first channel (News) works all right and the template code for it is below:

    {if segment_2=="uutiset"}
     {exp:channel:entries channel="uutiset"}
      <h1>{title}</h1>
      {news_body}
     {/exp:channel:entries}
    {/if}

    I created two new channels “fysioterapia” (3) and “video” (4) the same way as the News channel. All the templates, codes, paths etc. should be correct for the new channels.

    But the news content on channel 3 and 4 doesn’t show up. Shows just blank page (but with correct template of course). Only listing on what ever site you want to add it works with the code below.

    {exp:channel:entries channel="fysioterapia"}<a href="http://{url_title_path=%27fysiot/uutinen%27}" class="red">{title}</a>{/exp:channel:entries}

    So, what I’d like is to get those new channels work as the News channel. Have I missed something from General configuration, Channel Administration or?

    News URL path is /ajankohtaista/uutiset/
    Fysio /fysiot/uutinen/ (listing on /palvelut/fysioterapia/)
    Video /media/video/ (listing on /media/videot/)

    If I add {video_body} on the /media/videot/ site to listing, it gets the content, but when you click the news title (link), content doesn’t show up on that news page.


    Thanks in advance!

  • #2 / Feb 02, 2012 7:57pm

    Sean C. Smith

    3818 posts

    Hi drinn,

    I’m sorry that you are experiencing this problem. I’d like you to check a couple of things for me. double check that you don’t have a typo in the channel name. Also check that the channel has entries in it. Additionally could you post back with more of your template code - additional context here will be helpful.

    Finally what version of ExpressionEngine are you using?

    Sean

  • #3 / Feb 04, 2012 7:18am

    drinn

    3 posts

    I am using ExpressionEngine v2.1.3. There are no typos in the channel names and they have entries in it.

    Here’s the code of the fysioterapia news page template

    <!DOCTYPE html>
    <html lang="en">
    <head>
    
     <title>Fysioterapia | Palvelut | Suomen Proteesipalvelu Oy</title>
    
     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
     <meta http-equiv="Content-Language" content="eng" />
     <meta http-equiv="content-style-type" content="text/css" />
     <meta name="description" content="Suomen Proteesipalvelu Oy" />
     
    {css}
    {favi}
    {js}
    
    </head>
    <body>
     <div id="container">
    {embed="parts/logo"}
    {embed="navs/palvelut"}
      <div id="polku">
       <a href="http://index.shtml" class="polku">Suomen Proteesipalvelu Oy</a> / 
       <a href="http://{site_url}palvelut" class="polku">Palvelut</a> /
     <a href="http://{site_url}palvelut/fysioterapia" class="polku">Fysioterapia</a> / Fysioterapeutin palsta
      </div> <!-- subnav -->
      <div id="content">
       <div id="content_left">
    
    {if segment_3=="fysioterapia"}
     {exp:channel:entries channel="fysioterapia"}
      <h1>{title}</h1>
      {fys_body}
     {/exp:channel:entries}
    {/if}
    
       </div> <!-- content left -->
       <div id="content_right">
        <h1>Ota yhteyttä</h1>
        {img}phone.png Soita 09 347 8350
        {img}email.png <a href="mailto:[email protected]" class="emailr">Lähetä sähköpostia »</a>
       </div> <!-- content right -->
      </div> <!-- main -->
    {embed="parts/footer"}
     </div> <!-- container -->
    </body>
    </html>
  • #4 / Feb 04, 2012 10:04am

    mark186282

    290 posts

    lots of ways to troubleshoot this:

    first, lets eliminate the if->then as a possible fault:

    if you see the “pass”, then we know the if->then is fine, and we’re just dealing with the entries tag:

    {if segment_3=="fysioterapia"}
    pass
     {exp:channel:entries channel="fysioterapia"}
      <h1>{title}</h1>
      {fys_body}
     {/exp:channel:entries}
    {/if}

    next, let’s see that the execution of your channel entries tag is functional, but just not returning results

    {if segment_3=="fysioterapia"}
     {exp:channel:entries channel="fysioterapia"}
      <h1>{title}</h1>
      {fys_body}
       {if no_results}
       sorry, no results
       {/if}
     {/exp:channel:entries}
    {/if}


    if you’re not getting any results at this point… we have a couple of other things to check:

    1.  are you logged in as a super-admin when you’re viewing the page (if so, you shouldn’t encounter any permissions-related issues)
    2.  is there data? (I know this is a no-brainer check… but are there entries in the fysioterapia channel?... i.e. are you *positive* that you have results that should be showing…?
    3.  if you turn the debugger on, are you getting any errors on the page?

    lets us know if you come up with any abnormalities with the above tests… and we’ll go from there.  I feel your pain, “no results” errors are sometimes the hardest to troubleshoot.

  • #5 / Feb 04, 2012 11:25am

    drinn

    3 posts

    Thanks for the help.

    I tried removing {if} and now the new channels work all right?! with the code below:

    {exp:channel:entries channel="video"}
     <h1>{title}</h1>
     {video_body}
    {/exp:channel:entries}

    The question is why News section works with the {if}. Other channels without {if}.

  • #6 / Feb 07, 2012 6:10pm

    Sean C. Smith

    3818 posts

    drinn,

    I’m glad that Mark was able to help you out. What was the url on the other channel? did it match up correctly with the segment_3 check?

    Sean

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

ExpressionEngine News!

#eecms, #events, #releases