Keyword

Written by username

  • Sveinung Grytøyr
  • Sveinung Grytøyr's Avatar Topic Author
  • Offline
  • New Member
More
12 years 9 months ago - 12 years 9 months ago #101905 by Sveinung Grytøyr
Written by username was created by Sveinung Grytøyr
Is there a way to set written by as username instead of Name in global configuration?

Much like this post btw, my username is Moraxxus, and i would like that to be displayed instead of my full name...

Please Log in or Create an account to join the conversation.

More
12 years 9 months ago #101906 by Lefteris
Replied by Lefteris on topic Re: Written by username
Hi. No there is no such an option.

Please Log in or Create an account to join the conversation.

  • Sveinung Grytøyr
  • Sveinung Grytøyr's Avatar Topic Author
  • Offline
  • New Member
More
12 years 8 months ago #101907 by Sveinung Grytøyr
Replied by Sveinung Grytøyr on topic Re: Written by username
And there is no way to achieve this at all? I do not understand why you would want to post by your real name in stead of user name...

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #101908 by Lefteris
Replied by Lefteris on topic Re: Written by username
I also do not understand why you want to post by your username instead of your real name.... Anyway you can achieve what you want by making a template override and use the following code:
<?php echo $item->author->username; ?>
or
<?php echo $this->item->author->username; ?>

depending on the context.

Please Log in or Create an account to join the conversation.

  • Sveinung Grytøyr
  • Sveinung Grytøyr's Avatar Topic Author
  • Offline
  • New Member
More
12 years 8 months ago #101909 by Sveinung Grytøyr
Replied by Sveinung Grytøyr on topic Re: Written by username
Thank you so much! This helped and worked like a charm.

Unfortunatley, I am to much of a noob to find the way to do the same for user comments. As far as I can see, it is already picked out to be userName. Am I in the wrong file, or is it another way to change the comment author?

Really appreciate it!

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #101910 by Lefteris
Replied by Lefteris on topic Re: Written by username
Comments is a different situation because a commenter may be a guest and do not have username.

Please Log in or Create an account to join the conversation.

  • Sveinung Grytøyr
  • Sveinung Grytøyr's Avatar Topic Author
  • Offline
  • New Member
More
12 years 8 months ago #101911 by Sveinung Grytøyr
Replied by Sveinung Grytøyr on topic Re: Written by username
Yes, but are there a way to set it up so that they will use the username instead of name IF they are logged in?

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #101912 by Lefteris
Replied by Lefteris on topic Re: Written by username
Everything can be done. You need to know PHP programming and hack K2 core files to achieve this. There is no option for this in K2.

Please Log in or Create an account to join the conversation.

  • Sveinung Grytøyr
  • Sveinung Grytøyr's Avatar Topic Author
  • Offline
  • New Member
More
12 years 8 months ago #101913 by Sveinung Grytøyr
Replied by Sveinung Grytøyr on topic Re: Written by username
Okay. Regardless, thank you wery much, you have been of great help, and I cannot start to tell you how much I appreciate the great service at K2! Thank you again!

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #101914 by Lefteris
Replied by Lefteris on topic Re: Written by username
You are welcome.

Please Log in or Create an account to join the conversation.

  • Pocket Money Marketing
  • Pocket Money Marketing's Avatar
  • Offline
  • New Member
More
12 years 5 months ago #101915 by Pocket Money Marketing
Replied by Pocket Money Marketing on topic Re: Written by username

Lefteris Kavadas wrote: I also do not understand why you want to post by your username instead of your real name.... Anyway you can achieve what you want by making a template override and use the following code:

<?php echo $item->author->username; ?>
or
<?php echo $this->item->author->username; ?>

depending on the context.


Thanks for this. Could you please give an indication to which file this needs to be changed. I am surprised it is not an option in the global configuration? There are many people who do not wish to publish articles using their own names, especially if it on a local community site.

Regards
Mike

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum