2

I'm branching this off of another question: Assets 2 MSM Cannot Upload or view images

I'm not seeing any tag output from Assets in the second site.

I'm running EE 2.5.5 with Assets 2.0.5.

This is a site that I've been migrating from an older site, so it's a clean slate. It's not an upgrade. I've migrated entries into the new database and updated templates that I've copied in.

Yesterday I set up a second site using MSM. I'm using Master Config, so there were a few issues with paths for third_party add-ons and templates, but those have been resolved. My templates are outputting correctly now.

I have content in a channel on the 1st site (Site1): That channel's name is experience. If I drop the following code into a template on Site1, it works fine, including outputting the URLs of the Assets field's image ({event-story-gallery-image}):

{exp:channel:entries site="default_site" channel="experience" orderby="event-story-sort-order" sort="asc" dynamic="off"}
<a class="story-link" href="/experience/story/{url_title}"><span class="view">View</span><span class="border"><!-- empty div --></span>
    <img src="{main_url}{event-story-gallery-image}" width="320" height="230" />
    <span class="caption1">{title}</span>
    <div class="divider"><!-- empty div --></div>
</a>
{/exp:channel:entries}

If I drop that same code into a template in Site2, everything outputs correctly except the {event-story-gallery-image} tag. That outputs nothing. It's not an incorrect path, it's just not outputting.

I have the following in Master Config:

$config['assets_site_url'] = '/index.php';

$config['assets_cp_path'] = 'admin/';

To be able to view the CP under Site2, I have to change the master config as follows:

// $base_url = $protocol . $_SERVER['HTTP_HOST'];
$base_url = 'http://ee2.morinsfinecatering.localhost:8888';
//$base_path = $_SERVER['DOCUMENT_ROOT'];
$base_path = dirname(__FILE__).'/../../../public';

That lets me see the CP correctly in Site2.

Accordingly, I changed my Assets settings as follows:

$config['assets_site_url'] = 'http://ee2.morinsfinecatering.localhost:8888/index.php';
$config['assets_cp_path'] = 'http://ee2.morinsfinecatering.localhost:8888/admin/';

I still cannot see my Assets files in the CP in Site2, nor get any output from the tags.

I've confirmed that the following in my config.php is the correct path as well:

$config['third_party_path'] = $base_path . "/client_ee/add-ons/system/third_party";
echo $config['third_party_path']; exit;
1

After checking the first Control Panel and seeing that my Assets files did not display with those changes, I made the following changes:

$config['assets_site_url'] = '/index.php';

$config['assets_cp_path'] = dirname(__FILE__).'/../../../public/admin/';

I'm now able to:

  1. See my Assets files in Site1's CP.
  2. See my Assets files output from the Assets tags in Site2.

I'm still unable to see my Assets files in the CP under Site2, but that's not a concern to me. The client will only work with the CP under 1 URL.

| improve this answer | |
  • Thanks for posting how you solved this, Mark! Did you want to troubleshoot that second site, or totally drop that concern? There's probably a cross-domain issue there that we'd need to resolve. – Lisa Apr 3 '13 at 19:29
  • Hey Lisa – I'm not going to invest much more time in it at this point. If anything pops out at you or it's something you come across, I'll be happy to share further details. – Mark J. Reeves Apr 3 '13 at 19:32
  • Usually this happens because of a cross-domain reference. The easy check is to open your browser's debug console, go through the actions you want, while watching the debug console. It should report any JS errors to you which is where that security alert would show up. – Lisa Apr 3 '13 at 19:58
  • Ah, got it. I'll take a look at that. Thanks again! – Mark J. Reeves Apr 3 '13 at 19:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.