Issue with river object view

I have 3 plugin VideosTheWire Links Preview Advanced and TheWire Tools.

All the plugin has a common file: mod/< plugin_name >\views\default\river\object\< plugin_name >\create.php

All the 3 files has different feature. Create file for videos creates the view to display the videos on the river activity page, whereas TheWire Links Preview Advanced pulls the title and description of any link and created the view of link and TheWire Tools has a feature of reshare which is viewed as "Source: link of the shared item" in the river activity page.

Now as I stack all the plugin, the create file of the last plugin from the list is being used to generate the preview. However the above plugins are ignored.

Is there any way in which I can used all the create file for the preview of the respective plugin.

  • Views of the same name override, so I can see how river/object/thewire/create would conflict (the later plugin wins), but I don't know why videos would conflict.

  • You'll usually want a site-specific plugin (at the bottom of the list) just so you can define exactly the views you want when two plugins conflict but must be in a particular order.

  • Yes, you were right about videos plugin. I was just doing some testing and came to know that videos plugin is not causing any conflict.

    The issue is with TheWire Links Preview Advanced and TheWire Tools (the later plugin wins).

    Is there any way to identify the type of the river item?
     
    If that is possible then I can create another file in my custom plugin (last on the list) as follows:
     
    if(type==preview){
       // content for TheWire Links Preview Advanced
    }
    
    if(type==reshare){
       // content for TheWire Tools
    }
  • Anyways thanks for the help.. I solved it.

    Create a file with same name in my custom plugin and merged the content of both the file based on $attachment parameter. If the $attachment parameter is null then $excerpt for thewire_preview else $excerpt for thewire_tool.

  • You should consider sending a PR to one or both of those plugins. They might want the features, or they might want to figure out how to make their plugins collaborate more easily.