Commits

Anonymous committed ba7a912

added language filtering in CMSEntryListPlugin

  • Participants
  • Parent commits 5e1125e

Comments (0)

Files changed (1)

File cmsplugin_faq/cms_plugins.py

     
     def render(self, context, instance, placeholder):
 
-        #get all FaqEntryPlugin on this page
-        plugins = instance.page.cmsplugin_set.filter(plugin_type='CMSFaqEntryPlugin')
+        #get all FaqEntryPlugin on this page and this language
+        language = context.get('lang', settings.LANGUAGE_CODE)
+        plugins = instance.page.cmsplugin_set.filter(plugin_type='CMSFaqEntryPlugin', language=language)
         
         faqentry_plugins = []
 
         })
         return context
 
-plugin_pool.register_plugin(CMSFaqEntryLinkPlugin)
+plugin_pool.register_plugin(CMSFaqEntryLinkPlugin)