exp:weblog:entries tag not working in sub-sections
Posted: 25 June 2008 07:54 PM   [ Ignore ]  
Summer Student
Total Posts:  6
Joined  01-22-2008

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("<p>","",$raw_address);
$formatted_address = str_replace("<br />"," | ",$formatted_address);
?><?php echo $formatted_address ?></span><span class="contact-info"><a href="http://www.design-systems.net" target="_blank" title="Built by Design-Systems">ds</a></span></nobr>
    </
div>{/exp:weblog:entries}
</div>

Profile
 
 
Posted: 25 June 2008 08:06 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12375
Joined  04-29-2002

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.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 25 June 2008 08:36 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  6
Joined  01-22-2008

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.

Profile
 
 
Posted: 25 June 2008 09:22 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRank
Total Posts:  1994
Joined  05-07-2007

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

 Signature 
Profile
MSG
 
 
Posted: 26 June 2008 06:50 AM   [ Ignore ]   [ # 4 ]  
Summer Student
Total Posts:  6
Joined  01-22-2008

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 smile thanks again.

Profile
 
 
Posted: 26 June 2008 07:07 AM   [ Ignore ]   [ # 5 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23522
Joined  05-20-2002

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?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 26 June 2008 07:11 AM   [ Ignore ]   [ # 6 ]  
Summer Student
Total Posts:  6
Joined  01-22-2008

yes thank you. it can be closed smile

Profile
 
 
Posted: 26 June 2008 07:15 AM   [ Ignore ]   [ # 7 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23522
Joined  05-20-2002

Is done wink

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64908 Total Logged-in Users: 37
Total Topics: 81852 Total Anonymous Users: 30
Total Replies: 440056 Total Guests: 222
Total Posts: 521908    
Members ( View Memberlist )