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 )

43287 put(a) pogledan, 23 odgovor(a) 13.2.2014. 11:47:41Kreirao(la) sonap
mzilic

mzilic

13.2.2014. 13:41:28
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
Ovaj sadržaj još nije ocijenjen. 
2218 Reputacija 300 Ukupno objava
sonap

sonap

13.2.2014. 11:47:41
Hello,

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

Thanks,
Panos
Ovaj sadržaj još nije ocijenjen. 
475 Reputacija 52 Ukupno objava
mzilic

mzilic

13.2.2014. 11:55:47
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
Ovaj sadržaj još nije ocijenjen. 
2218 Reputacija 300 Ukupno objava
sonap

sonap

13.2.2014. 12:01:23
Ok Just found it!
When you fill in name and surname it is displayed instead of the username :)

Sorry about that!
Ovaj sadržaj još nije ocijenjen. 
475 Reputacija 52 Ukupno objava
sonap

sonap

13.2.2014. 12:05:35
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

Ovaj sadržaj još nije ocijenjen. 
475 Reputacija 52 Ukupno objava
mzilic

mzilic

13.2.2014. 12:10:54
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
Ovaj sadržaj još nije ocijenjen. 
2218 Reputacija 300 Ukupno objava
sonap

sonap

13.2.2014. 12:39:24
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 #>
Ovaj sadržaj još nije ocijenjen. 
475 Reputacija 52 Ukupno objava
mzilic

mzilic

13.2.2014. 12:45:18
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
Ovaj sadržaj još nije ocijenjen. 
2218 Reputacija 300 Ukupno objava
sonap

sonap

13.2.2014. 12:51:51
Thank you. I am doing as you say but some templates dont support the <#AuthorDisplayName #> tag at all resulting in empty output...
Ovaj sadržaj još nije ocijenjen. 
475 Reputacija 52 Ukupno objava
mzilic

mzilic

13.2.2014. 13:08:06
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
Ovaj sadržaj još nije ocijenjen. 
2218 Reputacija 300 Ukupno objava
sonap

sonap

13.2.2014. 13:38:07
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 ¨)
Ovaj sadržaj još nije ocijenjen. 
475 Reputacija 52 Ukupno objava
1 2 3