0

I had setup the multiple sites using MSM and want to publish content to different sites different categories in a single submit from the admin.

0

I couldn't really find addon already made that will do that. What you'd need to do is craft an one yourself.

This is a bit complex of an addon to make, so I'll try and outline what you'd need to do.

First, create an module with a tab file. Use that Tab file to generate a tab on your publish page (call it something like "MultiPost"). Then, make an accessory that modifies that tab with JavaScript on your publish pages. Use the accessory file to look up your sites, the channels for those sites, and your channel categories. Then, in the accessory, use jQuery to create checkboxes in your MultiPost tab, aka, a list of checkboxes for which sites to post it to, then in that site, which channel (only submit to channels that share the same field group), and which channel categories. Also with that jQuery, hook to the publish form Submit button; stop the submission on click (preventDefault). Use jQuery to add hidden input fields to the entry form. Those hidden input fields will have the value from your MultiPost tab (what sites you've clicked to post it to, what channels, what categories per channel per site). After you add your hidden inputs, continue with form submission. Then, use an extension hooked to, perhaps, channel_form_submit_entry_end, to grab your custom POST data that you inserted into the entry form (ee()->input->post('my_hidden_field_with_site_ids_to_duplicate_this_channel_entry_to')). Use that data, and the channel_form_obj, and the Channel Entries API to submit new entries to your other sites, modifying the channel id and categories along the way.

See, wasn't that easy? I don't recommend actually trying to create an addon of such complexity unless this is your full-time job and your employer is aware of the immensity of developing this addon. What you're asking is technically feasible, but not how you should be going about it. You might be able to use MX Cloner:

http://www.eec.ms/add-ons/mx-cloner/

To just clone entries from one site to another, but I'm not sure if it has the option to change site_id or categories in the process.

0

Why not just publish once and share the same content/entries across your MSM sites? That way you don't need to mass duplicate everything.

2
  • The "different categories" part is why I didn't suggest that.
    – jrothafer
    Oct 5 '15 at 16:43
  • You can still share category groups/categories across MSM sites...? Oct 6 '15 at 16:54
0

Here is my solution. Lets assume we have two sites setup under the EE using the Multisite manager and the shortcodes are

1.) default_site   ===>>  Default Site
2.) second_site    ===>>  Second Site

Now We had already setup the following category structure under each sites Category group called NEWS

Category Structure for the default_site

NEWS [Category Group] {Assigned to channel called News}

1.) Default Site [Category]
    3.) Latest News
    4.) Top Stories
2.) Second Site [Category]
    5.) Latest News
    6.) Top Stories

Category Structure for the second_site

NEWS [Category Group] {Assigned to channel called News}

6.) Default Site [Category]
    8.) Latest News
    9.) Top Stories
7.) Second Site [Category]
    10.) Latest News
    11.) Top Stories

FOR DEFAULT SITE

To fetch Latest news from each site we use the following entry tag

{exp:channel:entries channel="news" category="3|8" offset="0" disable="categories|category_fields" track_views="one" dynamic="no" status="open|featured" limit="10" paginate="bottom" site="default_site|second_site"}

To fetch Top Stories from each site we use the following entry tag

{exp:channel:entries channel="news" category="4|9" offset="0" disable="categories|category_fields" track_views="one" dynamic="no" status="open|featured" limit="10" paginate="bottom" site="default_site|second_site"}

FOR SECOND SITE

To fetch Latest news from each site we use the following entry tag

{exp:channel:entries channel="news" category="5|10" offset="0" disable="categories|category_fields" track_views="one" dynamic="no" status="open|featured" limit="10" paginate="bottom" site="default_site|second_site"}

To fetch Top Stories from each site we use the following entry tag

{exp:channel:entries channel="news" category="6|11" offset="0" disable="categories|category_fields" track_views="one" dynamic="no" status="open|featured" limit="10" paginate="bottom" site="default_site|second_site"}

Here everything is based on category ID.

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.