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.

MSM - display channel content from other site

March 15, 2011 8:50pm

Subscribe [3]
  • #1 / Mar 15, 2011 8:50pm

    skgreene

    40 posts

    Hi - using EE v2.1.3 build 20101220 AND MSM Version: 2.0 Build: 20101215 and trying to pull content from one site into another using the following tag

          {exp:channel:entries channel="blog" limit="15" site=""}

    i have also tried

          {exp:channel:entries channel="blog" limit="15" site="default_site"}

    AND
          {exp:channel:entries channel="blog" limit="15" site="not otherSite"}

    In fact, only one of my sites has a “blog” channel, but that shouldn’t matter. Problem being, it doesn’t seem to pull content from the one site that has “blog” channel into any other sites as expected.

    I checked and the mysql query still has the site ID of the site I am currently browsing. As Follows:

    SELECT t.entry_id FROM exp_channel_titles AS t
    LEFT JOIN exp_channels ON t.channel_id = exp_channels.channel_id LEFT JOIN exp_members AS m ON m.member_id = t.author_id WHERE t.entry_id !=’’ AND t.site_id IN (‘14’)  AND t.entry_date < 1300231523 AND (t.expiration_date = 0 OR t.expiration_date > 1300231523) AND (t.channel_id = ‘205’ OR t.channel_id = ‘206’ ) AND t.status = ‘open’ ORDER BY t.sticky desc, t.entry_date desc, t.entry_id desc LIMIT 0, 15

    Am I missing something?

  • #2 / Mar 16, 2011 1:29pm

    Brandon Jones

    5500 posts

    Hi skgreene,

    1. The site with the content you want definitely has the short name “default_site”, correct?
    2. Have you tried the exp:channel:entries tag (with the site parameter) in a template on the “secondary” site all by itself?
    3. What MSM-specific values do you have in the “secondary” site’s index.php?

    When I say “secondary” site I’m referring to site id 14.

  • #3 / Mar 16, 2011 9:07pm

    skgreene

    40 posts

    I think I found the issue. In my secondary site, I am including a template from my primary site:

    {embed="default_site:register/product"}

    then, in my primary site product template I’m trying to pull content from the primary site only. It’s a no go no mater what combination I try. HOWEVER, if I take my whole template and copy and paste it into my secondary site, the following tag works:

    {exp:channel:entries channel=“blog” limit=“15” site=“default_site”}

    so it’s really just the combination of embedding a template AND garbing content from a different site that’s a problem.


    summer

  • #4 / Mar 17, 2011 3:08pm

    Sue Crocker

    26054 posts

    It may just depend on what you’re trying to embed. I was able to embed a simple text string from siteA to siteB…

  • #5 / Mar 17, 2011 5:06pm

    skgreene

    40 posts

    Well, Site B is embedding a template from Site A. I only want that template the grab Channel content from Site A even when it is embedded in Site B. However, but it only wants to grab content from Site B. Looking at the mysql statement, I’m concluding that when you embed a template, it’s smart enough to know what site you are including from and fixes the mysql statement to say “where site=Site B” even through the exp:channel:entries tag is trying to over ride that with asking for content from Site A.

    Can you confirm that there is no way around this?’

    Thanks
    summer

  • #6 / Mar 18, 2011 1:31pm

    Lisa Wess

    20502 posts

    Hi, Summer -

    I’m going to admit being a little bit confused.  Can you show us the exact template code you’re using, and tell us what site it’s on, and how/to what site you’re embedding it? Essentially, I need the exact step by step guide to how to reproduce your issue.

    ie:

    1.  Put this code in a template in site A.
    2.  Put this code in a template in site B.
    3.  view template from Site X.

    etc.

    Thank you!

  • #7 / Mar 29, 2011 9:22pm

    skgreene

    40 posts

    OK - I’ve been going round and round, and I think I’ve got something.

    Site “CA” embeds a master template from site “default_site”. Code is:
    {embed="default_site:tour-blog/index"}

    The “default_site” index template embeds “default_site” sub template (.leftNav). Code is:
    {embed="default_site:tour-blog/.leftNav" }

    The leftNav template is as follows:
            <!—START NAV—>
          <div id=“right_col” class=“slim-col”>
            <div class=“widget dark” id=“blog_sidebar”><div class=“padding-9”>

    Categories

              <ul>
                  {exp:channel:categories site="not JIBBERISHWORD" channel="Blog" }
                  <li>{category_name}</li>
                  {/exp:channel:categories}
              </ul>
              <div class=“hr”></div>

    Recent Posts

              <ul>
                  {exp:channel:entries site="not JIBBERISHWORD" channel="Blog" limit="5" sort="desc" dynamic="no"}
                  <li>{title}</li>
                  {/exp:channel:entries}
              </ul>
              <div class=“hr”></div>

    Archive

              <ul>
              {exp:channel:month_links site="not JIBBERISHWORD" channel="Blog" limit="50" }
              <!—{year_heading}

    {year}

    {/year_heading}—>
              <li>{month} {year}</li>
              {/exp:channel:month_links}
              </ul>
            </div></div>
          </div>
    <!—END NAV—>

    Now - the code in .leftNav doesn’t work, until I copy it all and paste it into my default_site index template, then the exp:channel:entries tags work, but the exp:channel:categories tag still doesn’t work. I guess I can live with moving the code in .leftNav into the default_site index template, but I really need exp:channel:categories to work… Any ideas?

  • #8 / Mar 30, 2011 1:19pm

    Lisa Wess

    20502 posts

    Hi, skgreene - let’s try this one tag at a time.

    So the channel categories tag is currently the problem child, right?  Now, if you put that exact code:

    {exp:channel:categories site=“not JIBBERISHWORD” channel=“Blog”}
                  {category_name}
                  {/exp:channel:categories}

    into the the “CA” site - then your categories list comes up, is that right?

    But if you then take it and put it in a template in the default_site - then pull it up on that site? What do you see?  We can get to embedding next.

    Thanks!

  • #9 / Mar 30, 2011 1:41pm

    skgreene

    40 posts

    nope -

    {exp:channel:categories site=“not JIBBERISHWORD” channel=“Blog”}
    {category_name}
    {/exp:channel:categories} 

    in the alone in the CA template returns nothing.

  • #10 / Mar 30, 2011 2:57pm

    Lisa Wess

    20502 posts

    But that does work on default_site, skgreene? What if you switch to include site= instead of exclusive.  ie:

    site="CA"
  • #11 / Mar 30, 2011 8:49pm

    skgreene

    40 posts

    On the CA site:
    {exp:channel:categories site=“CA” channel=“Blog”}
    {category_name}
    {/exp:channel:categories} 
    is a no go because there is no Blog Channel

    on the default site:
    {exp:channel:categories site=“not JIBBERISHWORD” channel=“Blog”}
    {category_name}
    {/exp:channel:categories}

    Works fine, or leaving out the site parameter all together is fine.

  • #12 / Mar 31, 2011 12:06am

    Lisa Wess

    20502 posts

    Ok, that makes sense.  Now if you embed

    {exp:channel:categories site=“CA” channel=“Blog”}
    {category_name}
    {/exp:channel:categories}

    from default_site to CA, you get no results still?

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

ExpressionEngine News!

#eecms, #events, #releases