Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Print blog name in Blog Post Transformation View modes: 
User avatar
Member
Member
jacques.honore-gmail - 5/7/2012 11:22:32 AM
   
Print blog name in Blog Post Transformation
Hello,

the problem I am facing is that I have 17 blogs on my website with blog posts in each blog. On the main front page of the website I list the latest blog posts.

How can I do to display the name of the blog in which the blog post are published? Is it possible to do it from the blog post transformation?

Thanks for your help.
Jacques

User avatar
Kentico Support
Kentico Support
kentico_janh - 5/7/2012 5:51:35 PM
   
RE:Print blog name in Blog Post Transformation
Hello,

Yes, it is possible. Please just add following code into your transformation:
<%# CMS.Blogs.BlogHelper.GetParentBlog(Eval<int>("DocumentID"), false).DocumentName %>

Best regards,
Jan Hermann

User avatar
Member
Member
jacques.honore-gmail - 6/5/2012 12:46:31 PM
   
RE:Print blog name in Blog Post Transformation
Thanks Jan, it works smoothly!

User avatar
Member
Member
jacques.honore-gmail - 6/5/2012 12:47:34 PM
   
RE:Print blog name in Blog Post Transformation
Do you know if it is possible in addition to the name to get the link of the blog document?

Regards,
Jacques

User avatar
Kentico Support
Kentico Support
kentico_janh - 6/5/2012 2:46:02 PM
   
RE:Print blog name in Blog Post Transformation
Hello,

Of course, try this:
<a href='~<%# CMS.Blogs.BlogHelper.GetParentBlog(Eval<int>("DocumentID"), false).NodeAliasPath %>'><%# CMS.Blogs.BlogHelper.GetParentBlog(Eval<int>("DocumentID"), false).DocumentName %></a>

Best regards,
Jan Hermann

User avatar
Member
Member
jakonore - 6/8/2012 2:26:24 AM
   
RE:Print blog name in Blog Post Transformation
Super it works perfectly. Thanks for your support.