Display User URL in front end
-
I would like to Display a User list (only for Users with role “members”.
Mailto-link with User Mail works fine.
But user URL works only for admins.
Is there a solution to this issue?
Thanks
Klaus
-
Hi klaus
Are you using the right ‘link to’ ?
There is no conditional logic to say ‘only use user URLs for admin users’ or ‘only use user URL when it is admin viewing’. If it is link to user URL you have chosen it will use it if it exists.The only ‘admin users’ condition is For the ‘edit users’ Linktype it will only offer the link if the viewer has the capability to edit users.
Please check and let me know your situation.
It′s a bit weird.
The field shown is a custom field containing the Website address and it is formatted as “User URL”. The original field is empty.
Viewing as admin I see all the URL as link.
When I login as normal member I see (saw) only my own URL as link, the other not linked.
Now I filled a different URL into the WP field “website” of one other user record. Result: in the list the URL (from the custom field!) is displayed correctly as URL.
Seem I have to copy the URL from the custom field to the WP field for every record.
Regards
KlausKlaus
SHORT ADVICE:
1) go to ‘find fields’. Define your custom field as a URL. Save.
2) set the linktype for your custom field to ‘none’. Save
3) rebuild cacheLONGER ANSWER:
I think you are confusing ‘format’ and ‘linktype’. The Latest plugin version allows one to defined the type of field (see “find fields” settings), which then allows one to either have a default format (like having a url link to itself) but these are NOT the same as the “linktype”.When you say ‘format as user_url’ you must mean that you are choosing the linktype ‘user url’.. THis means that the plugin will link to the wordpress user url (the wp website) for that user. So if the field is username and one chooses linktype ‘user url’ – it will show the username and link to the wordpress user url.
If the field is your custom field and you choose linktype user url, it may show the custom url BUT will still link to the wordpress user url (if it exists) NOT the custom field url.Your browser may also confuse you in that IF there is a ‘space’ in your custom field, the plugin will think it is not empty, and so will generate a href with a space as thetext. Browsers don’t like spaces with hrefs & may show the href instead of the ‘space’ with a link. (Possibly the plugin should check for spaces and rather treat a field with spaces as empty)
Maybe this table will help [edit oh dear – can’t make it format legibly]
user url/wp website..custom field...linktype......result ===================..============...========......====== www.usersurl.com.....empty..........user url......empty www.usersurl.com.....a space........user url......browser may show www.usersurl.com empty................some text......user url......some text with no link empty................a url..........user url......a url with no link www.usersurl.com.....a url..........user url......a url with href to www.usersurl.com IF YOU DEFINE IN "FIND FIELDS" that your custom field is a url, and leave the linktype as none, then www.usersurl.com a url none a url with href to 'a url'
Later when functions are available in a later version, one will be able to choose formats for urls as indicated in the ‘format’ options. Currently only image is available, but that only makes sense if the url is an image url.
Hi Anmari,
thanks.
You were right, was not aware of the difference between format (in “Find fields..”) and link type (in “Configure / Format fields”).
Now I have a custom field as “url” and the linktype is “none”.But what I see is still the URL (in different type with/without http, with/without www)…
Klaus
Oh dear Apologies,
the fieldtype functionality is new and I have now realised I have some addons that making me think the default for a url was working for custom fields, but when going back to basics, it is not yet, not even in addon!
I cannot release an update right now as I have some not fully tested changes in the next version. You can however do one of the following:
either use the wordpress website (user url) field as you suggested above, rather than the custom field
OR
(in your site specific plugin – see https://ottopress.com/2011/creating-a-site-specific-snippets-plugin/)
1) add a function for the format dropdowns for urls: eg: to make the dropdown for “url text as link” work:
if (!function_exists('ausers_format_url_text_link')) { //20170309 function ausers_format_url_text_link ($url, $fld, $u) { //expects url return '<a href="'.$url.'">'.$url.'</a>'; } }
OR
add your very own custom format function with for your field as per
https://wpusersplugin.com/2645/format-any-field-any-way-you-wish/. That way you can make it do whatever you want.
- The topic ‘Display User URL in front end’ is closed to new replies.