Portal Engine Questions on portal engine and web parts.
Version 4.x > Portal Engine > {%link%} macro View modes: 
User avatar
Certified Developer 13
Certified Developer 13
matt-pixelbuilders - 2/11/2013 11:40:32 AM
   
{%link%} macro
Hi guys,

Currently working on an email template (Forums.NewPost).

Wonder if you could help with this {%link%} macro - could anyone tell me where the property for the domain exists?

On output it currently doesn't contain www. The site domain name does contain www.

Thanks

User avatar
Kentico Support
Kentico Support
kentico_janh - 2/12/2013 1:30:20 AM
   
RE:{%link%} macro
Hello,

This macro is hardcoded in DLL files, so there is no way for you how to add there the www prefix/subdomain to its output. However you can implement a custom macro which would return appropriate link instead:

Appendix A - Macro expressions

Best regards,
Jan Hermann

User avatar
Certified Developer 13
Certified Developer 13
matt-pixelbuilders - 2/13/2013 11:36:11 AM
   
RE:{%link%} macro
Thanks Jan,

I wonder if you could help in getting the post within the macro?

I'm currently trying:


CMSForum_ForumPost post = sender.SourceObject as CMSForum_ForumPost;
postUrl = ForumFunctions.GetPostURL(post.PostID, post.ForumID);


However post is coming out as null, how would I access the post property within the macro in order to use it?

Thanks

User avatar
Kentico Support
Kentico Support
kentico_janh - 2/19/2013 5:07:46 AM
   
RE:{%link%} macro
Hello,

Have you tried to debug that code? Do post.PostID and post.ForumID variables really contain IDs?

Best regards,
Jan Hermann

User avatar
Certified Developer 13
Certified Developer 13
matt-pixelbuilders - 2/20/2013 4:07:13 AM
   
RE:{%link%} macro
Hi, managed to get it out via a bit of a dirty method:

string postUrl = sender.SourceParameters[2,1].ToString();

The SourceObject was coming out as null previously.

Thanks for your help