MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

How to display name instead of username when publishing, posting in forum etc.  (Mono Support )

Viewed 17725 time(s), 23 post(s) 2/13/2014 11:47:41 AMby sonap
mzilic

mzilic

2/13/2014 1:41:28 PM
Hello,

There are no plans to my knowledge. However, the following can easily be implemented in any solution using the approach I described. There are various scenarios how one might want to use or extend MonoX and thus supporting all scenarios is usually not possible.

Regards
This content has not been rated yet. 
2218 Reputation 300 Total posts
sonap

sonap

2/13/2014 11:47:41 AM
Hello,

I would like to ask if it's possible to dipslay users by their name / surname instead of the username.

Thanks,
Panos
This content has not been rated yet. 
475 Reputation 52 Total posts
mzilic

mzilic

2/13/2014 11:55:47 AM
Hello,

That is possible. You would need to override ParseTemplateTags of the discussion modules and replace the data in username tags with a different caption which in your case is a name or last name.

Regards
This content has not been rated yet. 
2218 Reputation 300 Total posts
sonap

sonap

2/13/2014 12:01:23 PM
Ok Just found it!
When you fill in name and surname it is displayed instead of the username :)

Sorry about that!
This content has not been rated yet. 
475 Reputation 52 Total posts
sonap

sonap

2/13/2014 12:05:35 PM
mzilic, thank you very mouch for your answer.

Could you explain how this is done? ("ParseTemplateTags of the discussion modules and replace the data in username tags with a different caption which in your case is a name or last name.")

Panos

This content has not been rated yet. 
475 Reputation 52 Total posts
mzilic

mzilic

2/13/2014 12:10:54 PM
Hi,

A general approach would be to inherit a desired control and override the ParseTemplateTags method. In that method in the tags collection replace a desired tag value, ex:
tags["<# UserName #>"] = "my new value";
Regards
This content has not been rated yet. 
2218 Reputation 300 Total posts
sonap

sonap

2/13/2014 12:39:24 PM
Some Templates have as supported tag the <# Author #> tag. How can I replace it with the <# AuthorDisplayName #> tag?

In general, I want in every single place to have <# AuthorDisplayName #> instead of <# Author #>
This content has not been rated yet. 
475 Reputation 52 Total posts
mzilic

mzilic

2/13/2014 12:45:18 PM
If you'd like to replace the Author tag with the AuthorDisplayName you need to edit the templates and either remove the Author tag from the markup or rename the author to AuthorDisplayName. Templates can be found in the App_Templates directory.

Regards
This content has not been rated yet. 
2218 Reputation 300 Total posts
sonap

sonap

2/13/2014 12:51:51 PM
Thank you. I am doing as you say but some templates dont support the <#AuthorDisplayName #> tag at all resulting in empty output...
This content has not been rated yet. 
475 Reputation 52 Total posts
mzilic

mzilic

2/13/2014 1:08:06 PM
If you change the template Ids in the templates then as well you need to add support for the new tags in the ParseTemplateTags method. MonoX will at runtime replace the tags in the templates using the data in the Hashtable tags collection.

Regards,
Mario
This content has not been rated yet. 
2218 Reputation 300 Total posts
sonap

sonap

2/13/2014 1:38:07 PM
Thank you.
I have two questions (since I am not a developer):

Are there any plans to add the tag (<# AuthorDisplayName #> ) in the supported list for the webparts  were it isn't, in a future version? 
[ Templates / modules that don;t support it: 
BlogList.ascx
BlogPost.ascx
BlogComments.htm
RelatedContent.htm
NewBlogCommentMail.htm
NewBoardMail.htm
NewTopicMail.htm
NewCommentMail.htm ]

Are there any similar plans for the <# username #> tag to have a <#name-surname #> alternative in the foroum's modules in a future build?

Thank's a lot for your time ยจ)
This content has not been rated yet. 
475 Reputation 52 Total posts
1 2 3