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.

How to stop "sub folder" viewing

August 03, 2012 8:48am

Subscribe [2]
  • #1 / Aug 03, 2012 8:48am

    stevemckinney

    12 posts

    I’m not sure that’s what exactly you’d call it but I can’t figure out how I’d stop content from being viewed on my website at http://iamsteve.me/portfolio/view

    Ideally that would go to a 404 page or have a way for me to control what’s displayed there. How can I solve this, no amount of googling has brought me on to something that works.

    Thanks in advance!

    Edit:

    I think it’s down to strict URL’s not being enabled, but no matter how many times I try enabling them it won’t set. If this is what stops it, what would be preventing that from being on?

  • #2 / Aug 03, 2012 12:33pm

    Ralph

    78 posts

    You can use require_entry=“yes” parameter to your channel entries tag and then add this in the tag:

    {if no_results} {redirect="404"} {/if}

    More info: http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html/#require-entry-yes

  • #3 / Aug 03, 2012 1:35pm

    stevemckinney

    12 posts

    EDIT: ignore this as I posted and looked over my post I noticed there was curly quotes in the require_entry parameter so that’s obviously not going to work. It’s worked so thank you very much!

    That doesn’t appear to work. I think it worked in one case to do with a category url: http://iamsteve.me/blog/show/category this redirects it to the error page. Maybe I’m doing something wrong? Here’s my portfolio/view template.

    {embed="/include/header" entry_title="{exp:channel:entries channel="portfolio" status="Latest|open|draft"}{title}{/exp:channel:entries}"}
    
     {exp:channel:entries channel="portfolio" require_entry=“yes" status="Latest|open|draft" disable="categories|member_data|pagination|trackbacks"}
     {if no_results} {redirect="error"} {/if}
      <header class="page_title">
       <h1>{title}</h1>
       <h2>{brief_summary}</h2>
    <p>  </header><br />
      <br />
      <section role="region" id="entry"><br />
       {full_image}<br />
       {item_description}{if live_url}<a href="http://{live_url}" title="View the live version of {title}">Live version</a>{/if}<br />
      </section><br />
     {/exp:channel:entries}<br />
     {portfolio_nav}</p>
    
    <p>{embed="/include/footer"}

  • #4 / Aug 03, 2012 3:59pm

    Lisa Wess

    20502 posts

    Hi, Steve -

    I just want to confirm - you now have this working? If not, please update us on where you are at so we can help you out.

    And thank you to Patrick for stepping in and helping out!

  • #5 / Aug 03, 2012 4:01pm

    stevemckinney

    12 posts

    I can confirm I’ve got it working, thank you.

  • #6 / Aug 03, 2012 4:02pm

    Lisa Wess

    20502 posts

    Awesome!  Thank you Steve and Patrick.  Have an awesome weekend, and please let us know if you need anything else.

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

ExpressionEngine News!

#eecms, #events, #releases