Topic: Multiple Weblogs in EE

I am trying to set up a page in EE that is a little complicated in theory. I am setting up a page where during service times we "edit" the weblog "service_setup" allowing the admin to turn on the video player, chat window, etc.

But after the service is over they go in and turn everything off for a generic template.

I have added the {if} variables and everything was working fine until I went and added separate weblog for the content that actually goes inside the {if} variables. And now they content will not show up. I hope that make since. I'm guessing that the problem lies somewhere with the fact that I have 2 weblogs open at the same time before closing one.

I looked over the forums and docs and found where I could add more than weblog by putting weblog="service_setup | speakers" but that screwed everything up.

here is my code

{exp:weblog:entries weblog="service_setup" disable="member_data|trackbacks" sort="asc" dynamic="off"}


{if videoplayer == "On"}

content

{/if}

{if videoplayer == "Off"}

                            		
content

{/if}


{if chat == "On"}

content
							
{/if}	


{if chat == "Off"}
 
content

{/if}	
				

{exp:weblog:entries weblog="worship_leader" disable="member_data|trackbacks" sort="asc" dynamic="off"}

 {content}

{/exp:weblog:entries}

                                     
{exp:weblog:entries weblog="speakers" disable="member_data|trackbacks" sort="asc" dynamic="off"}

 {content}
                       
{/exp:weblog:entries}
{/exp:weblog:entries}

Last edited by jasonathopi (2009-03-23 20:41:54)

Re: Multiple Weblogs in EE

You cannot have {exp:weblog:entries} nested within each other. If you want to reference one weblog's content within another weblog, you'll have to set up relationships between the weblogs in question. For more info:

http://expressionengine.com/docs/module … tries.html
http://expressionengine.com/docs/module … tries.html

I feel a nostalgia for an age yet to come...

Re: Multiple Weblogs in EE

Ok so I have looked over it a few times and 'm confused. I don't think this will work for me because I have multiple custom fields for my entries.

{If worship_leader== Stu} then display {stu_pic} & {stu_description}

but

{If worship_leader== Andrea} then display {andrea_pic} & {andrea_description}


the {If worship_leader== Stu} comes from the "weblog=service setup" but their info comes from weblog="worship_leaders" with conditionals


Any ideas?

Re: Multiple Weblogs in EE

jasonathopi wrote:

the {If worship_leader== Stu} comes from the "weblog=service setup" but their info comes from weblog="worship_leaders" with conditionals

Any ideas?

It seems like you have two main options:

1. Use a Relationship field and the relationship tags to pull in the worship leader's info
2. Or you can keep you current structure and use "embedded templates"

I'd prob go with #1 but if you need to use #2 then you'll need to use "embedded templates" and embedded variables to make it work..

{exp:weblog:entries weblog="service_setup" disable="member_data|trackbacks" sort="asc" dynamic="off"}

    content
				
    {if worship_leader == "Stu"}

       {embed="worship/leader" entry_id="12"} 

    {/if}

{/exp:weblog:entries}

Then in your embedded  "workshop/leader" template, you could use the entry_id parameter to call the right leader's profile.

{exp:weblog:entries weblog="worship_leader" entry_id="{embed:entry_id}" disable="member_data|trackbacks" sort="asc" dynamic="off"}

 {content}

{/exp:weblog:entries}

That approach seems to rely too much on hard coding stuff but could work if that's not a big deal to you.