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.

Selectively push weblog entries across multiple sites

July 22, 2010 12:55pm

Subscribe [5]
  • #1 / Jul 22, 2010 12:55pm

    Ray Brown

    33 posts

    A coworker of mine set up seven sites within one MSM install.  Each site has a weblog called ‘news,’ and each ‘news’ weblog has a custom field called ‘news_target.’  The ‘news_target’ field is currently a FF Multi-select field, and it contains options for each site’s ID, like so:

    1 : Site A
    2 : Site B
    3 : Site C
    4 : Site D
    5 : Site E
    6 : Site F
    7 : Site G

    The idea is that our client can publish a news article once, but also choose to show this news article on some, all, or none of the other sites.  I would probably have created one master news channel instead of seven, but that’s neither here nor there.

    Anyway, the docs say that using the search: parameter in the {exp:weblog:entries} tag will only work on text inputs, textareas, and drop-down lists.  Since ‘news_target’ is a FieldFrame field, it makes sense that using this param wouldn’t work correctly.

    I added another field - a text input, this time - called ‘show_on_site_a.’  I did this just for testing purposes, but passing arguments through this new field gives me the same result as the FF multi-select.  This result is that my {exp:weblog:entries} tag shows all news entries from all sites, regardless of the search: value.

    What’s the best way to solve this problem?

  • #2 / Jul 22, 2010 12:58pm

    Sue Crocker

    26054 posts

    Which build/version of ExpressionEngine are you using? You can find that at the bottom on any control panel page.

  • #3 / Jul 22, 2010 1:35pm

    Ray Brown

    33 posts

    Hey, Sue.  I’m using EE 1.6.9 Build 20100430.  Let me know if you need anything else.  Thanks!

  • #4 / Jul 22, 2010 5:51pm

    I did something just like this, using MSM but allowing the user to specify what site, but I used categories as the site identifiers.  So all they do is publish normally, choose the category (which allows them to specify more than one site to show it on) and then in the templates you simply specify a category.

    It works a treat.

  • #5 / Jul 22, 2010 6:11pm

    Chris Chiles

    17 posts

    I’ve used FF multi-select with the weblog:entries search parameter and it worked fine.  Fieldframe inserts each option into the database separated by a line-break, so I had to do the search with \W at the end to search on the full word.  I’m not sure how it would work if the option name is a number, like you have, so if it’s not a big deal to reselect the sites for the news entries, I’d suggest changing “1 : Site A” to “site_a : Site A” and searching with “search:news_target=”=site_a\\W”

    - Chris

  • #6 / Jul 22, 2010 8:22pm

    Ray Brown

    33 posts

    What the…Chris, I swear I tried the \W setting, but I must have screwed it up the first time.  Now it works like a charm!  Thanks!  I owe you multiple beers.

  • #7 / Jul 22, 2010 8:27pm

    Brandon Jones

    5500 posts

    Thank you for the input, all. Glad we have a solution!

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

ExpressionEngine News!

#eecms, #events, #releases