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.

Path variables in MSM

July 30, 2012 9:33am

Subscribe [2]
  • #1 / Jul 30, 2012 9:33am

    Russ Back

    142 posts

    Hey guys

    If I’m on site_a and I call in some entries from site_b, is there a way I can use the path global variable for site_b? For example this is a template on site_a:

    {exp:channel:entries site="site_b" etc…
        <a href="http://{path=detail/{url_title}}">{title}</a>
    {/exp:channel:entries}

    On site_a that outputs site_a/detail/whatever instead of site_b/detail/whatever, which won’t work. I guess I could put the template in site_b and call it from there?

  • #2 / Jul 30, 2012 5:22pm

    Robin Sowell

    13255 posts

    Hi Russ- can you try something like {comment_url_title_auto_path}?  Just make sure each site has correct paths for the individual channel settings and that should work for you.

  • #3 / Aug 03, 2012 4:07am

    Russ Back

    142 posts

    Hadn’t thought of that, thanks. It works as I’m not using comments and can safely use it.

    I’m doing this in an embed from Site A:

    {embed="site_b:includes/.job-listing"  limit="3"}

    As an embed is parsed before it is returned to the calling template I would expect the path variable to evaluate what’s in the Site B’s preferences, not Site A. If it was a snippet from Site B, fair enough, but this seems like a bug to me. Would you agree?

  • #4 / Aug 03, 2012 11:16am

    Robin Sowell

    13255 posts

    Ah- I do see your logic.  It wouldn’t have occurred to me, because I’m so used to how it does work.  But yes- I totally grok how you’d have the expectation you did.

    What it boils down to is- it largely just pulls in the template and treats it as if you were embedding a template from the current site.  Which ... is actually how I expected it to work.  Ditto the use of the channel tag- if it’s being pulled into ‘A’ it works just like it would if it was on an ‘A’ template- so you’d need to use the site parameter if you were pulling in site B content- even if it’s in a site B template and being embeded.

    So- I’d say it’s expected and thus not a bug.  But I can totally see how your expectations are reasonable.  Given it’s a bit of a toss up IMO, I think for consistency it doesn’t make sense to make such a significant change.

    Make sense?  It’s working as designed, but how you thought it would work does make a lot of sense.

  • #5 / Aug 03, 2012 3:38pm

    Russ Back

    142 posts

    That view makes sense. Would it be possible and reasonable to somehow request the path from the other site? If you’re featuring content from one site with a view to linking to it, it makes sense to be able to link to the other site.

  • #6 / Aug 06, 2012 5:42pm

    Kevin Smith

    4784 posts

    Hey Russ,

    There’s not a way to have EE automatically return the the path or domain name from another MSM site like you’re looking for, but perhaps in the cases where you need that to happen, you could just use a user defined global variable instead. Have you given that a try?

  • #7 / Aug 21, 2012 3:18am

    Russ Back

    142 posts

    Thanks Kevin

    I could see how that would work but for now we’ve gone with the {comment_url_title_auto_path} option.

  • #8 / Aug 22, 2012 1:00pm

    Dan Decker

    7338 posts

    Hey Russ,

    Good to see you have a solution that works for you!

    Is there anything else I can assist you with?

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases