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.

Pages module and dynamic weblog

July 24, 2008 7:14am

Subscribe [3]
  • #1 / Jul 24, 2008 7:14am

    H&O

    34 posts

    Hi guys,

    Normally my business partner Paul does the technical part, but since he is on vacation I’ll have to do a bit coding. It’s probaply a common problem, but I don’t know were to look. 

    So I used te page module to make some pages and made for some of these pages special templates. One of those templates has to display the last entry of a certain weblog and some links to older entry’s (like a real simpel archive) in a column on the right . The problem is that the ‘archive’ links ( {url_title} } don’t work. It seems perfect: http://www.domain.com/currentpage/weblog_entry_x but it keeps sending me to the homepage (where the good entry is shown!). It seems like expressionengine is ignoring ‘currentpage’.

    Ideas? Thanks 😊

  • #2 / Jul 24, 2008 10:15am

    Robin Sowell

    13255 posts

    Hm- I’m a little fuzzy on what’s up.  So you’re using two tags on the template- one to show the page, one to show some navigation.  And the navigation tag is goofing?  Is it not showing entries at all, or somehow goobering their output?  And- assuming the above is correct, can you paste the core code you’re using?

  • #3 / Jul 24, 2008 10:23am

    evasion

    58 posts

    Could you please post some part of your code please ?

  • #4 / Jul 24, 2008 10:32am

    H&O

    34 posts

    Thanks for the reply’s, let me demonstrate:

    moresoft.nl
    (only firefox 3, yet)

    on the homepage you’ll see the weblog entry’s on the right, and some links beneath. When you click on ‘m, they work fine. When you navigate to ‘partners & referenties’ you’ll find the same situation (actually same code because of embedding that part) but no entry will show up and the ‘archief’ url’s are still fine but not working (sent you to homepage).

    This is my humble code:

    {exp:weblog:entries weblog="column" dynamic="on" limit="1"}
      <div class="entry">
          <h2>{title}</h2>
    <p>      <div class="entry-meta"><br />
             {entry_date format="%d %F, %Y"} - Door Ruud van der Meer<br />
          </div><!--.entry-meta--><br />
          {introductie}<br />
          {uitbreiding}<br />
      </div><!--.entry--><br />
    {/exp:weblog:entries}

  • #5 / Jul 24, 2008 10:48am

    evasion

    58 posts

    I’ve tried your link and archives works fine : it display the homepage’s template but article on the right is changing.

    Is the problem related to showing entries, or showing entries on the correct template ?

  • #6 / Jul 24, 2008 11:03am

    H&O

    34 posts

    That last one: showing the correct entry if you click on one of the archive links on a page other then the homepage without leaving that page.

  • #7 / Jul 24, 2008 11:14am

    Robin Sowell

    13255 posts

    On the ‘partners’ page, those archive entries end up with a url of:
    http://www.moresoft.nl/partners-referenties/het_voordeel_van_procesmonitoring
    On the home page, they’re using the main index- no ‘partners-referenties’.  So- that’s the problem, correct? 

    IF that’s correct- I think you’re showing us the wrong code block- need to see the tag generating the links.  May be embedded, though hard to say for sure.

    Am I following the issue- and can you spot the tag that generates the links in question?

  • #8 / Jul 24, 2008 11:18am

    evasion

    58 posts

    In fact if you want this page to be displayed into the partners-referenties’s page, you must duplicate this code :

    {exp:weblog:entries weblog="column" dynamic="on" limit="1"}
      <div class="entry">
          <h2>{title}</h2>
    <p>      <div class="entry-meta"><br />
             {entry_date format="%d %F, %Y"} - Door Ruud van der Meer<br />
          </div><!--.entry-meta--><br />
          {introductie}<br />
          {uitbreiding}<br />
      </div><!--.entry--><br />
    {/exp:weblog:entries}

    into the “index” template of the “partners-referenties” group. Is that what you’re doing ?

  • #9 / Jul 24, 2008 11:29am

    H&O

    34 posts

    Hi guys,

    Robin, the code generating the archive links (directly beneath the entry code, in the same embed-thingy) is as following:

    {exp:weblog:entries weblog="column" dynamic="off"}
      <li><a href="http://{url_title}">_  {entry_date format="%d/%m/%Y"}{title}_   </a></li>             
       {/exp:weblog:entries}

    Evasion, that code you’re seeing actually is from the partners-referenties page. Its embedded into both that template, the homepage and the contact page. It only behaves different on the homepage. There it is dynamic and actually showing an entry, on the other pages it is not showing anything and url’s containing the title of an entry (like http://www.moresoft.nl/partners-referenties/het_voordeel_van_procesmonitoring) don’t make difference.

  • #10 / Jul 24, 2008 11:43am

    Robin Sowell

    13255 posts

    Ah- link needs tweaking.  It’s acting like a relative link- make sense?

    I personally like to use {comment_url_title_auto_path}- it builds a url based on the per weblog path settings in ‘Admin- Weblog Admin- Weblog Management’- for each weblog, look in ‘Paths’.  But- there are lots of others- such as {url_title_path=weblog/archives}- use that, and just specify the template_group/template you want the links pointing to.

    Relative links can be tricky on EE because of the pseudo directory structure the urls reflect.

  • #11 / Jul 24, 2008 12:24pm

    H&O

    34 posts

    Maybe you’re right, but I don’t understand.

    Yes, I can use {url_title_path=paginas/contact} (where paginas is the template group and ‘contact’ the template) and in case the contact page, it works:

    http://www.moresoft.nl/paginas/contact/moresoft_officieel_gestart_nu_al_vakantie/
    http://www.moresoft.nl/paginas/contact/het_voordeel_van_proces_monitoring

    But the whole /paginas/contact/ seems unnecessary and my partner always manages to get nice and clean urls with the pages module (like /contact/weblog_title).

    I think I’m still missing something

  • #12 / Jul 24, 2008 12:33pm

    Robin Sowell

    13255 posts

    You can pretty much point them to whatever template you want.  Are they ‘pages’ in the EE sense?  If so- use

    {if page_url != ''}
    <li><a href="http://{page_url}">{title}</a>
    {if:else}
    <li><a href="{url_title_path=">
    {/if}

    So- if it’s assigned a page url, it will use that.  If it’s not- it will basically use the default index template on the default template group.  Which- may/may not be what you want, and if you’re using a 404 you still need a template group in there at a minimum.  But really it’s just- what do you want the url to look like; does the entry show up at that url ok.  Then- format the url to look like you want.

    Help at all?

  • #13 / Jul 24, 2008 12:45pm

    H&O

    34 posts

    I’m still thinking about you’re last reaction, in the meanwhile:

    I think the difference is, between a normal situation, that I don’t want to specify a certain page to read an weblog entry. Visitors should be able to read it when ever they want, so if someone is on the ‘contact’ page, he should be able to read an archived entry and if he is on the homepage he should be able to.

  • #14 / Jul 24, 2008 1:01pm

    Robin Sowell

    13255 posts

    Definitely agreed- and one reason I use {comment_url_title_auto_path}- just set the path I want once per weblog and don’t have to try to remember template names.  Guess what I’m trying to say- you can show them pretty much wherever you want, it’s up to you to decide what the url should be and then be consistent in its use.  And what is currently jamming things is the relative url issue.

    So- one way to fix it- go to ‘Admin- Weblog Admin- Weblog Management’ and for each relavant weblog, set the search and comment paths to be http://www.moresoft.nl/paginas/ (or whatever you want- that would mean you are using the paginas template group, index template to show the single entry pages)- then just use {comment_url_title_auto_path} anytime you want to link to a single entry page- and the links will always be http://www.moresoft.nl/paginas/url_title.

  • #15 / Jul 24, 2008 1:16pm

    H&O

    34 posts

    Robin, again thanks for your reaction. I’ve implemented your solution and you can see the result for yourself; from everywhere you click a archive link, you’ll be redirected to /paginas/weblog_name. But that is not what I’m trying to do. I want users to stay on the contact page when clicking on a link from the archive on that page.

    I’ve put dynamic=“off” to be clear: Go to the contact page, you’ll see the weblogentry on the right. Two titles beneath it, when you click one of these titles (one actually is the weblog entry shown above) you should go to the exact same page, the contact page in this case, but showing the entry you just clicked.

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

ExpressionEngine News!

#eecms, #events, #releases