Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > UserContributions and Multi Language View modes: 
User avatar
Member
Member
poyanj-yahoo - 11/6/2012 5:24:23 AM
   
UserContributions and Multi Language
Hi,
I want to use UserContributions to Insert "News" "Articles" and ...
I dont want user access to CmsDesk and I just added "Cotribution List" web part to news and article page.my site has 2 Languages.the thing that I need is thah when user Insert a News or Article in any language one document Insert automaticly in Other Language with that content and then User just translate content.I have done this in"EditForm.ascx.cs" in "CMSModules\Content\Controls\UserContributions" Path:
in "SaveDocument()" Method:
else
{
Node = formElem.Save();

CMS.TreeEngine.TreeProvider provider = new CMS.TreeEngine.TreeProvider(CMS.CMSHelper.CMSContext.CurrentUser);
TreeNode NodeOtherLanguage = new TreeNode(Node.NodeClassName,provider);
NodeOtherLanguage = formElem.Save();
NodeOtherLanguage.DocumentCulture = "en-US";
if (Node.DocumentCulture == "en-US")
NodeOtherLanguage.DocumentCulture = "fa-IR";
NodeOtherLanguage.Update();

but this code only Change the Culture of document that recently added and dose not add new Document with other Cuture.

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/9/2012 3:34:34 AM
   
RE:UserContributions and Multi Language
Hello,

Please use following method instead:
node.InsertAsNewCultureVersion("de-de");

You can see API examples for new documents in different cultures in the Site Manager -> Support -> API Examples section.

Best regards,
Jan Hermann

User avatar
Member
Member
poyanj-yahoo - 11/21/2012 4:03:19 AM
   
RE:UserContributions and Multi Language
Hi,
when I want to use Node.InsertAsNewCultureVersion("de-de"); method it gives me error:
No overload for method InsertAsNewCultureVersion takes one Arguments"

User avatar
Kentico Support
Kentico Support
kentico_janh - 11/21/2012 7:23:31 AM
   
RE:UserContributions and Multi Language
Hello,

I have tested it and it worked properly. Please make sure you are using version 7 of Kentico CMS.

Best regards,
Jan Hermann