Page 1 of 1
[solved] Changing News author name from 'username' to 'first/last' name
Posted: Sat Oct 06, 2007 6:20 am
by peedub
Hi,
When posting a news module, the summary/detail says "Posted by: *username*", which is the username of the admin who logged in and posted the news.
What I wish to change is the "Posted by: *username*" to say "Posted by: *Firstname Lastname*", which are relative to the username logged in.
If you go admin > users & groups > users > and edit a user, there are fields for First Name and Last Name - these are what I want displayed on the news module as "Posted by".
I can't seem to find any simple way of doing this, so there's probably something in the module .php files to change, however I'm unsure of how to go about that also.
Any ideas?
I'm using CMSMS 1.1.3.1 and News Module 2.5.
Cheers
Re: Changing News author name from 'username' to 'first/last' name
Posted: Sat Oct 06, 2007 7:04 am
by alby
peedub wrote:
When posting a news module, the summary/detail says "Posted by: *username*", which is the username of the admin who logged in and posted the news.
What I wish to change is the "Posted by: *username*" to say "Posted by: *Firstname Lastname*", which are relative to the username logged in.
If you go admin > users & groups > users > and edit a user, there are fields for First Name and Last Name - these are what I want displayed on the news module as "Posted by".
I can't seem to find any simple way of doing this, so there's probably something in the module .php files to change, however I'm unsure of how to go about that also.
Look in Extensions > Modules > Help of News
$entry->authorname - The full name of the the author including First and Last name
Substitute in template entry->author with entry->authorname
Alby
Re: Changing News author name from 'username' to 'first/last' name
Posted: Sat Oct 06, 2007 7:16 am
by peedub
Whoopsies, I must have missed thatÂ
Apologies, but thank you.
EDIT: In fact, after actually trying the solution it appears that something must be wrong. The username still appears as the author.
Here's the edited template code, done in the Summary Template and Detail Template of the News page under Content...
Code: Select all
{if $entry->authorname}
<div class="NewsSummaryAuthor">
{$author_label} {$entry->authorname}
</div>
{/if}
I have tried adding new articles but the username still appears as the author.
Re: Changing News author name from 'username' to 'first/last' name
Posted: Sun Oct 07, 2007 5:38 am
by peedub
Bump, problem still persists. See previous post's edit.
Re: Changing News author name from 'username' to 'first/last' name
Posted: Sun Oct 07, 2007 8:06 am
by alby
peedub wrote:
EDIT: In fact, after actually trying the solution it appears that something must be wrong. The username still appears as the author.
Here's the edited template code, done in the Summary Template and Detail Template of the News page under Content...
Have you edited Dummary and Detail template that you use?
Templates in use have green check in News Admin.
Alby
Re: Changing News author name from 'username' to 'first/last' name
Posted: Mon Oct 08, 2007 2:14 am
by peedub
Oh I see now...
Making a new template and making the 'authorname' changes in there, then setting that template to default, did the trick.
Before, I was making changes in the "Default Detail Template" text area, and that wasn't applying the changes to the default 'Sample' template, which I assumed it was suppose to be doing.
Thanks, Alby, for your help.
Consider this solved
Edit: How do I add to your Karma?
Re: Changing News author name from 'username' to 'first/last' name
Posted: Mon Oct 08, 2007 8:06 am
by RonnyK
Peedub,
there was no need to make a new template. You could also edit the template available at the bottom that was marked as default.
If a topic is [solved], please mark it as solved by modifying the original post, and change the subject-line.
As for Karma, only users with more than 10 posts can give/take karma. If you've posted more than 10 replies, under other users name will be the "Karma/Smite"-option linked.
Ronny