Welcome, Guest
Username: Password: Remember me

TOPIC: ALIAS - More than one field

ALIAS - More than one field 28 Sep 2012 11:33 #4129

  • BTB300
  • BTB300's Avatar
  • Offline
  • Moderator
  • Posts: 415
  • Thank you received: 132
  • Karma: 47
Just Another Thought
An extension to the alias field could be to allow more than one field value

I am thinking along the lines of the ability to do this that is already available in the core...
<%user_first%> <%user_last%> (<%user_email%>) => john doe (This email address is being protected from spambots. You need JavaScript enabled to view it.)

For example an address book when two fields are used for the persons name [name] and [surname] the alias would then become john-doe

- you could then drag the two fields to the alias the alias would obviously become the persons full name

- if you wanted more fields you would pass the first alias to a second alias

- or even better allow more than one field to be dragged to the alias field and the order in which they are displayed is how they will be joined

A Further Addition - Create String function

the same as the alias field but allows you to combine fields to create a string of text an space character inserted between fields
- this would be useful when communicating specific information (message) to a user

[Your registration will expire on] [expire_date] [ after this date your access will be limited will not be able to access the] [members_area_name] [after this date]

Once again Just a thought
Last Edit: 28 Sep 2012 11:34 by BTB300.
The administrator has disabled public write access.

Re: ALIAS - More than one field 15 Nov 2012 23:54 #5402

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
  • Karma: 64
Great idea - this would be super useful to those less comfortable with SQL!

For those of you who are comfortable with it, it could be achieved manually by using MySQL's concatenate:
CONCAT('a.field1', ' ', 'a.field2') as your_alias
in any of your model's queries.

Best wishes,

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
Last Edit: 15 Nov 2012 23:54 by JoomGuy.
The administrator has disabled public write access.
Time to create page: 0.056 seconds

Get Started