Welcome, Guest
Username: Password: Remember me

TOPIC: Switch first and last name

Switch first and last name 3 years 2 months ago #41

Hi,

currently on the frontend the module shows the first name first. Is it possible to switch it so that the last name ist first?

Thanks,
Andreas
The administrator has disabled public write access.

Switch first and last name 3 years 2 months ago #42

  • pippo
  • pippo's Avatar
  • Offline
  • Administrator
  • Posts: 29
  • Thank you received: 8
Hi,
not at the moment, that's not possible to set by parameters. If you know a bit of php, though, it's easy to rewrite code in no time.
I think I'll collect all ideas soon and make upgraded version.
The administrator has disabled public write access.

Switch first and last name 3 years 2 months ago #43

Ok, unfortunately my php knowledge is not too good. I tried to change some parameters but couldn't make it work. Would it maybe be possible for you to send me a modified file? Or will you do this uptate soon?
The administrator has disabled public write access.

Switch first and last name 3 years 2 months ago #44

  • pippo
  • pippo's Avatar
  • Offline
  • Administrator
  • Posts: 29
  • Thank you received: 8
Hi Andreas,
I wanted to make quick change for you, but after refreshing my memory on contacts database table, I realized that name and lastname are not separate fields in Contacts extension of Joomla. Instead, there's just one field, NAME. If we had 2 fields, NAME and LASTNAME I could just switch them in sorting function and layout of module and you'd have your wish done. This way I have to break name into pieces separated by blank character, then sort it by last piece (presumably that would be last name), then reorder name itself to show Smith John instead of John Smith and then put it all back in module listing.
This is doable, of course, but much better solution for all of those who want this sorted as lastname, firstname is to put that order in Contacts when they're creating them. So just rename your contacts to match your request and module will do it's job.
Anyway, I can try to make all of these above, but it's not "quick fix" to add that possibility, PLUS I can not be sure if results are going to be what user wants:
let's presume someone has 2 names: Carrol Joanne Smith. Script can not make logic out of this, neither can I presume that solution is unique. Is this to become Smith Joanne Carrol? Ok, I am human and I know this should be Smith Carrol Joanne. But not the script. Or two lastnames: Carrol Smith Powers. This should be Smith Powers Carrol, right? But script would do something like Powers Smith Carrol, which would be wrong. Etc...
I took some of your time to read this, but I hope we're even since it took some of mine thinking about solutions :)
All in all - if you can reverse all names in your contacts to match your request - that's exactly what I would do for myself if I am using this extension (I mean contacts) in my website.
When I catch a bit of time I'll play with it, but now I'm into some other projects, so this hobby has to wait a bit more.
Let me know what you think of this. Cheers!
The administrator has disabled public write access.

Switch first and last name 3 years 2 months ago #45

Hi pippo,

thank you for your detailed reply. I see the problem an I will rename the contacts. This shouldn't be to much work.
Thanks for the effort.
The administrator has disabled public write access.
Time to create page: 0.037 seconds