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.

Referrential links to content between MSM sites (page_url calls)

November 22, 2010 12:00pm

Subscribe [2]
  • #1 / Nov 22, 2010 12:00pm

    b.kershner

    1 posts

    We’re currently running one large site and are in the process of “chunking-out” pieces into separate sites, and have run into a couple of questions that we can’t find answers to. We’re at EE 1.7.0 and Structure 2.2.4

    Here is the set-up: Our standard template calls for 3 pieces, a left column, a right column and a main body section. For the purposes of this question I’ll confine to the right column. For our main site, the code for the right_col is as follows:

    <div class="right-col">
    
      {exp:structure:nav_sub start_from="/{segment_1}" exclude_status="hidden|no_sub_nav|"}                                 
    
      {if embed:page_display_news != ""}
      <h5 class="rcol-news">Current News</h5>
        {exp:weblog:entries weblog="news_story" dynamic="off" limit="3" category="{embed:page_display_news}" disable="categories|member_data|pagination|trackbacks"} 
        <a href="http://{page_url}">{title}</a>
        {/exp:weblog:entries} 
        <a href="http://{path=news/releases}">More news</a> »
      {/if}
                                       
    </div>
    <!-- /right-col -->

    The section we’re having problems with is the “Current News” area. The news_story weblog exists on Site 1, and the list actually appears properly on sites 2, 3, etc. but the problem is when you click on the actual items in the list. For some reason the url of the item is not being brought across. {page_url} doesn’t seem to be a valid field that we can pull across.

    The news_story asset is managed by structure. We created a listing page called News Releases (page_url for that page is releases) that “owns” the news_story asset.. Because all of the other pieces (the category and entry title) are pulling in properly, its obviously an issue with pulling the page_url across the sites.  We’ve talked to the structure guys and they thought we should float the issue back this way.

    If there is any more information I can provide, I’ll be glad to.

  • #2 / Dec 01, 2010 3:53am

    timkelty

    177 posts

    This is definitely broken in the EE core weblog file.

    The problem is that when the weblog module parses the page_uri/url vars, it only looks through the array of uris from the site you’re currently on.

    I patched this locally in my mod.weblog by looping through all existing sites, rather than just the current one.

    In the Weblog constructor (around line 118):

    // CHANGED: Fusionary fix for cross MSM site page urls
            $this->sites = $DB->query("SELECT site_id, site_pages FROM exp_sites");
            $this->site_pages = array();
        foreach ($this->sites->result as $site)
        {
          $this->site_pages = $this->site_pages + unserialize($site['site_pages']);
        }

    Then around line 3340 reassign to our new var:

    // CHANGED: Fusionary fix for cross MSM site page urls
            // $site_pages = $PREFS->ini('site_pages');
            $site_pages = $this->site_pages;

    Seems to be working for now, but definitely seems like it should be fixed!

    Actually, to me it seems like the PREFS object should store cross MSM-site site_pages info, rather than just the ‘current’ one, which would similarly solve this issue.

  • #3 / Dec 01, 2010 4:05am

    timkelty

    177 posts

    Ah!
    I was about to submit a bug report and found this resolved issue: https://support.ellislab.com/bugs/detail/9999/

    Then found this in the docs:
    http://expressionengine.com/legacy_docs/modules/pages/display_page_content.html#load_site_pages

    {exp:pages:load_site_pages}

    Never new about that one! Of course that wont work for us, because we’re not using Pages, we’re using Structure. Bummer, well I guess I’ll stick with my hack then.

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

ExpressionEngine News!

#eecms, #events, #releases