Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Finding if a document exists in a certain culture View modes: 
User avatar
Member
Member
Yehuda - 5/13/2011 5:40:18 AM
   
Finding if a document exists in a certain culture
Hello,

Like the title says, I need to find if a document exists in a certain language,
and by that show or hide a link to that culture.
How can this be done?

Thanks

User avatar
Certified Developer 9
Certified Developer 9
charbf - 5/13/2011 11:23:24 PM
   
RE:Finding if a document exists in a certain culture
Hi,
You can use r42's webpart from the market

http://devnet.kentico.com/Marketplace/Web-parts/Language-Switch.aspx

User avatar
Member
Member
Yehuda - 5/14/2011 9:10:20 PM
   
RE:Finding if a document exists in a certain culture
Thanks. Forgot to look there.
Anyway, for those looking for a solution, I used TreeProvider.SelectNodesCount() to see if the document exists in another language.

User avatar
Kentico Developer
Kentico Developer
kentico_ivanat - 5/16/2011 2:50:26 AM
   
RE:Finding if a document exists in a certain culture
Hi,

you could use SelectSingleNode method to select appropriate culture version as well:


public virtual TreeNode SelectSingleNode(
int nodeId,
string cultureCode
)


Best regards,
Ivana Tomanickova


User avatar
Kentico Support
Kentico Support
kentico_radekm - 5/26/2011 6:49:12 AM
   
RE:Finding if a document exists in a certain culture
Hello.

Yes, you can use method Ivana mentioned. If returned TreeNode is empty, given document does not exist and you can perform required action. You can see some other API examples on http://devnet.kentico.com/docs/devguide/selecting_nodes.htm

Best Regards,
Radek Macalik