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 - pulling entries from one site to another

August 07, 2010 9:19pm

Subscribe [3]
  • #1 / Aug 07, 2010 9:19pm

    Sean C. Smith

    3818 posts

    Hello,

    I’ve got a family site where I’m pulling in blog entries in an unordered list of entry titles from my daughters blog (a separate site on an MSM install). I am pulling the entries no problem but the links to the individual entries are going to the wrong domain. Here is my my code

    <h4>Veronica's Blog</h4>
    <p>{exp:weblog:entries site="veronica" weblog="veronica" limit="5" dynamic="off" disable="trackback|member_data|comments"}<br />
        {if count=="1"}<ul class="side-nav">{/if}<br />
            <li><a href="http://{title_permalink=">{title}</a></li><br />
        {if count=="{total_results}"}</ul>{/if}<br />
    {/exp:weblog:entries}

    This template is on domain1.com and I expect the title_permalink to go to domain2.com however it is going to domain1.com

  • #2 / Aug 08, 2010 3:50pm

    Greg Salt

    3988 posts

    Hi Sean,

    You know that these entries are from a particular domain so you can do this:

    <h4>Veronica’s Blog</h4>
    <p>{exp:weblog:entries site="veronica" weblog="veronica" limit="5" dynamic="off" disable="trackback|member_data|comments"}<br />
        {if count=="1"}<ul class="side-nav">{/if}<br />
            <li><a href="http://domain.com/template_group/template/{url_title}">{title}</a></li><br />
        {if count=="{total_results}"}</ul>{/if}<br />
    {/exp:weblog:entries}

    Cheers

    Greg

  • #3 / Aug 08, 2010 9:29pm

    Sean C. Smith

    3818 posts

    Greg,
    not sure why I didn’t think about that - works. Umm.. suppose I was in a situation where I didn’t know the domain i.e. multiple sites using the same blog short name in one weblog entries tag. How would you ensure it works then?

  • #4 / Aug 08, 2010 9:40pm

    Lisa Wess

    20502 posts

    You could use {comment_url_title_auto_path}.  The path= variables use the site URL of the current site.  The variable I recommended is pulling from that weblog’s preferences.

  • #5 / Aug 08, 2010 9:53pm

    Sean C. Smith

    3818 posts

    Thanks Lisa - forgot about that one as I’ve always used {title_permalink}

  • #6 / Aug 09, 2010 3:38am

    John Henry Donovan

    12339 posts

    Glad Greg and Lisa were able to help. Feel free as always to start a new thread if you have any more questions.

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

ExpressionEngine News!

#eecms, #events, #releases