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.

Unauthorized Redirect Page

September 15, 2007 11:31am

Subscribe [2]
  • #1 / Sep 15, 2007 11:31am

    rmeder

    97 posts

    Info:  I have setup a page “main_site/register” to which users are redirected if they are denied access to any page on the site.  The page uses conditionals Ex:

    {if group_id == "5"}

    to determine the message that should be displayed to the user.


    I have placed the messages in a “blog” where I keep all static content (name: static_content).


    I am attempting to pull the messages with the following code:

    {exp:weblog:entries weblog="static_content" limit="1" url_title="registered_guest"}
    
    <h2 class="title"><a href="http://{title_permalink}">{title}</a></h2>
    <div class="entry">
    {page_body}
    </div>
    
    {/exp:weblog:entries}


    Problem: When an unregistered user is redirected, the page comes up with some test info (I have it displaying the group_id), but a message (weblog entry) does not appear. 


    Questions:
    1.  Isn’t it possible to specify a url_title when someone is being sent to the page via a redirect?


    2.  Do I just have something coded wrong that is preventing this from working properly?

     

    Thank you for any assistance.

    Regards,

    Rick


    PS.  It works fine if I go directly to the page Ex: “{site_url}main_site/register”

  • #2 / Sep 17, 2007 11:47am

    grantmx

    1439 posts

    If I’m not mistaken, the URL title limits what’s queried by the URL passed to it.  Which means only the data associated with the url “http://something.com/something/registered_guest” will get displayed.

    That’s probably why its not displaying because the redirect isn’t moving the correct URL data for your weblog entry to work.

    It sounds like you just want to display a particular entry within your static_content weblog, correct?  Then all you need to do is remove url_title and add entry_id=“5” to your entries tag.  “5” is just an arbitrary number.  You also, might want to add: dynamic=“off”  to clear out anything passed to it.

    Hopefully that will fix it.

  • #3 / Sep 17, 2007 12:08pm

    rmeder

    97 posts

    Works Perfect!  Thank you for your help!!  I’m still a bit green with EE.  I really appreciate the assistance.

    Best regards,

    Rick

  • #4 / Sep 17, 2007 12:12pm

    grantmx

    1439 posts

    Sweet! I use the forums to learn more myself.

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

ExpressionEngine News!

#eecms, #events, #releases