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.

News items on home page showing incorrect URL and link back t home page

March 01, 2012 9:47pm

Subscribe [2]
  • #1 / Mar 01, 2012 9:47pm

    cmscss

    144 posts

    Hi There,

    I haven’t used EE for a year so am super rusty.

    I’m pulling news items into the home page from a particular category. The news items are displaying but the {page_url} isn’t being applied to the headline and button - so the news items are just linking back to the home page.

    The site has been live for over a year using the following code:

    <ul class="listing inner">
    
    {exp:channel:entries channel="news_items" dynamic="no" limit="2" category="15" orderby="date" sort="desc" disable="comments|member_data" status="not Not on MAIN"}
    
    <!-- news item -->
    <li class="group">
    <div class="c12 title">
    <h3><a href="http://{page_url}">{title}</a></h3>
    <p>{entry_date format="%l %F %j %Y"}<br />
    </div></p>
    
    <p><div class="c8"><br />
    <a href="http://{page_url}" class="button sml">Read full story</a><br />
    </div><br />
    </li><!-- end news item --></p>
    
    <p>{/exp:channel:entries}</p>
    
    <p></ul><!-- end news listing -->

    I know I’ve faced this issue before but for the life of me can’t remember what is wrong - no templates have changed.

    Any help would be much appreciated.

    Cheers

    ben

  • #2 / Mar 02, 2012 4:10pm

    Shane Eckert

    7174 posts

    Hello cmscss,

    I am sorry to hear you are running into this problem.

    Were there any changes recently? An update to ExpressionEngine or to an Add-On?

    Are you linking to a page associated as a static page by the Pages Module? That’s when the use of {page_url} is required.

    Is the Pages Module still installed and does the page display okay on it’s own?

    I will do my best to help you get this resolved. Please let me know what you find and we will go from there.

    Cheers,

  • #3 / Mar 02, 2012 8:42pm

    cmscss

    144 posts

    Thanks heaps for the reply - answers below:

    Were there any changes recently?

    The client accidentally loaded a a pdf into an image field on the home page then saved - they also created a news entry and saved it.

    An update to ExpressionEngine or to an Add-On?

    There has been no maintenance on this site for about 4 months - I discovered the issue after the client uploaded that pdf and said something was wrong. This doesn’t make any sense I know!

    Are you linking to a page associated as a static page by the Pages Module?

    The home page is a static page controlled by Structure and the home page template contains the code from the previous post which pulls in entires from the news channel.

    That’s when the use of {page_url} is required

    So how would you pull the entries in - from memory, I did it that way because dynamic is off. But as I say, I’m feeling VERY rusty on all this EE stuff sorry.

    Is the Pages Module still installed and does the page display okay on it’s own?

    I believe pages interferes with structure so It’s not installed and I can’t seem to figure out what the full url to the news items is to display it. I can see the url title of the news entry, but can’t figure out the url structure before it in order to preview the page.

    Install notes:
    - EE v2.1.3 with multi-site manager installed
    - Home page is in it’s own channel with it’s own template
    - News articles in separate channel
    - Structure is installed and is managing the home page but not the news items channels

    Sorry, I just can’t seem to work out what has happened.

  • #4 / Mar 05, 2012 3:20pm

    Shane Eckert

    7174 posts

    Hello cmscss,

    Thank you for answering all my questions. I appreciate that.

    I do not think you should be using page_url. Depending on how you have things setup, there are several tags available for building links. But to be honest, because you are using Structure and Structure’s purpose is to change the way URL’s work in ExpressionEngine, it would be helpful to also ask this question of over at Structure. Jack and Travis should be able to give some direction.

    Structure might be the reason you are using {page_url} instead of “url_title_path” or “path=” or similar.

    Does that make sense?

    Please let me know if you need clarification or if I can help you with anything else.

    Cheers,

  • #5 / Mar 05, 2012 6:48pm

    cmscss

    144 posts

    Thanks mate, am now working with the Structure guys.

    Sorry for wasting your time.

    Cheers

    Ben

  • #6 / Mar 05, 2012 6:50pm

    Shane Eckert

    7174 posts

    Hey Ben,

    Your not wasting my time at all, and this may prove to be an ExpressionEngine issue and not Structure. I just wanted to make sure that you are talking to them as well.

    I appreciate your posting your question.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases