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.

exp:weblog:entries tag not working in sub-sections

June 25, 2008 10:54pm

Subscribe [3]
  • #1 / Jun 25, 2008 10:54pm

    here’s the problem. i have a template that is working as an article page on my site. it has no problem displaying data with exp:weblog:entries from the current weblog but not other weblogs.

    for example: i’m in the case studies section of my website on the case studies homepage. there’s a footer on the page that is using exp:weblog:entries to pull contact information data from the contact weblog and it works fine. once i click through to a case studies article, the contact information in the footer no longer appears.

    i feel like it has something to do with the URL.

    when i use this URL, everything shows up on the page:
    http://www.example.com/index.php/case_studies/study/

    but when i use this URL (which is the URL to the article/study), the contact footer information doesn’t show up:
    http://www.example.com/index.php/case_studies/study/fictional_company_1/

    here’s my code, for those that are interested (and yes, i have PHP parsing turned on.. like i said, this works fine on other higher sectioned pages.. but, for sub-sections, not.) this is just the footer code and i made sure that all of my code on the page is correct. when i comment out all the other code on the page this footer code still doesn’t work on these sub-section pages! weird.

    <div id="footer">{exp:weblog:entries weblog="contact" disable="categories|member_data|pagination|trackbacks" search:title="=Contact Us" sort="asc"}
        <div id="footer-contact">
    <span class="contact-info">(o) {contact_office_phone_number}</span><span class="contact-info">(f) {contact_fax_number}</span><span class="contact-info">{contact_email_address}</a></span>
        </div>
        <div id="footer-address">
    <nobr><span class="contact-info"><?php
    $raw_address = "{contact_address}";
    $formatted_address = str_replace("","",$raw_address);
    $formatted_address = str_replace("
    "," | ",$formatted_address);
    ?><?php echo $formatted_address ?></span><span class="contact-info"><a href="http://www.design-systems.net" title="Built by Design-Systems" target="_blank" rel="noopener">ds</a></span></nobr>
        </div>{/exp:weblog:entries}
    </div>
  • #2 / Jun 25, 2008 11:06pm

    Sue Crocker

    26054 posts

    PHP parsing is either done for input or output. If you are in a loop, you need to be using output.

    But in any case, why PHP? Why not use an embedded template?

    You can set {contact_address} to be formatted as none.

  • #3 / Jun 25, 2008 11:36pm

    it is set to output (and i’m using PHP here to reformat some data stored in another weblog for use in the footer) and works fine on every other page on the website EXCEPT here in a sub-section of this weblog. i don’t think that it has anything to do with the PHP but i do think that it has something to do with that last bit of the URL. i tried taking out all the PHP and still the contact information doesn’t show up in this template.

  • #4 / Jun 26, 2008 12:22am

    Greg Aker

    6022 posts

    in the footer {exp:weblog:entries} tag, make sure to have

    dynamic="off"

    or it’s not going to populate on a url like:  http://www.example.com/index.php/case_studies/study/fictional_company_1/

    -greg

  • #5 / Jun 26, 2008 9:50am

    greg, thank you!!! that worked. now i completely understand what that dynamic parameter does. before this i really had no idea how to use it 😊 thanks again.

  • #6 / Jun 26, 2008 10:07am

    Robin Sowell

    13255 posts

    Hee- yea, once you actually run into an issue where you need to use it, the dynamic parameter suddenly becomes clear.  My thanks as well, Greg.

    We good to close this one out?

  • #7 / Jun 26, 2008 10:11am

    yes thank you. it can be closed 😊

  • #8 / Jun 26, 2008 10:15am

    Robin Sowell

    13255 posts

    Is done 😉

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

ExpressionEngine News!

#eecms, #events, #releases