[solved] Changing News author name from 'username' to 'first/last' name

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
peedub

[solved] Changing News author name from 'username' to 'first/last' name

Post 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
Last edited by peedub on Tue Oct 09, 2007 12:31 am, edited 1 time in total.
alby

Re: Changing News author name from 'username' to 'first/last' name

Post 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
peedub

Re: Changing News author name from 'username' to 'first/last' name

Post 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.
Last edited by peedub on Sat Oct 06, 2007 7:44 am, edited 1 time in total.
peedub

Re: Changing News author name from 'username' to 'first/last' name

Post by peedub »

Bump, problem still persists. See previous post's edit.
alby

Re: Changing News author name from 'username' to 'first/last' name

Post 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
peedub

Re: Changing News author name from 'username' to 'first/last' name

Post 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?
Last edited by peedub on Mon Oct 08, 2007 2:17 am, edited 1 time in total.
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Changing News author name from 'username' to 'first/last' name

Post 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
Locked

Return to “CMSMS Core”