- Posts: 38
- Thank you received: 0
URL Field displays Clickable Icon
- Vinny Hebert
- Topic Author
- Offline
- Junior Member
Less
More
6 months 2 weeks ago #167162
by Vinny Hebert
URL Field displays Clickable Icon was created by Vinny Hebert
I have a field that is going to display their LinkedIn profile. Instead of displaying a link, I'd like it to display the LinkedIn font awesome icon that will be clickable instead of the URL. Where would I do this?
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
6 months 2 weeks ago #167191
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic URL Field displays Clickable Icon
Hi Vinny
For this, you would need to customize the members list layout. The file you need to customize is components/com_osmembership/view/members/tmpl/default.php
Once the modification is done, you should move the modified file to template override templates/template_name/html/com_osmembership/members folder so that the change won't be lost when you update to future releases of the extension
Regards,
Tuan
For this, you would need to customize the members list layout. The file you need to customize is components/com_osmembership/view/members/tmpl/default.php
Once the modification is done, you should move the modified file to template override templates/template_name/html/com_osmembership/members folder so that the change won't be lost when you update to future releases of the extension
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- Vinny Hebert
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
6 months 2 weeks ago #167200
by Vinny Hebert
Replied by Vinny Hebert on topic URL Field displays Clickable Icon
This might be beyond me. I see where I need to make the change but not where it wouldn't affect the other fields. I'm not sure how to isolate that one field.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
6 months 2 weeks ago #167204
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic URL Field displays Clickable Icon
You can determine the field base on id of that field. For example:
if ($field->id == 17)
{
// This is the code for the field with ID = 17
}
else
{
// This is the code for the field for other fields
}
Hope that helps
Tuan
if ($field->id == 17)
{
// This is the code for the field with ID = 17
}
else
{
// This is the code for the field for other fields
}
Hope that helps
Tuan
Please Log in or Create an account to join the conversation.
- Vinny Hebert
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
6 months 2 weeks ago #167213
by Vinny Hebert
Replied by Vinny Hebert on topic URL Field displays Clickable Icon
I've tried in several spots where I thought the field was being rendered and nothing changed. The field shows the URL in both the Members List and the Member profile page. In both, I'm trying to get
wrapped with the url value to make the icon link. I can't find where I do this. I'm sorry.
Code:
<i class="fa-brands fa-linkedin" style="color: #0a66c2;">
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
6 months 2 weeks ago #167216
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic URL Field displays Clickable Icon
Hi Vinny
Please reply to the support ticket you created let me know ID of the field. I will try to help with this override
Regards,
Tuan
Please reply to the support ticket you created let me know ID of the field. I will try to help with this override
Regards,
Tuan
Please Log in or Create an account to join the conversation.
- Vinny Hebert
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
6 months 2 weeks ago #167220
by Vinny Hebert
Replied by Vinny Hebert on topic URL Field displays Clickable Icon
done
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
6 months 2 weeks ago #167221
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic URL Field displays Clickable Icon
I decided to implement the override in a different way. The override file is /templates/yootheme/html/com_osmembership/fieldlayout/fieldvalue.php
Here is the code to show you the idea:
Regards,
Tuan
Here is the code to show you the idea:
Code:
if ($row->id == 16)
{
if ($rawValue && filter_var($rawValue, FILTER_VALIDATE_URL))
{
?>
<a href="<?php echo $rawValue ?>"><i class="fa-brands fa-linkedin" style="color: #0a66c2;"></i></a>
<?php
}
}
else
{
echo $fieldValue;
}
Regards,
Tuan
The following user(s) said Thank You: Vinny Hebert
Please Log in or Create an account to join the conversation.
- Vinny Hebert
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 38
- Thank you received: 0
6 months 2 weeks ago #167232
by Vinny Hebert
Replied by Vinny Hebert on topic URL Field displays Clickable Icon
So instead of modifying the column in the Member List or the row in the profile, you altered the output of the field. Perfect. Thank you.
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
6 months 1 week ago #167243
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic URL Field displays Clickable Icon
Yes. It is possible to override output of the field, so I decided to make that override instead. By doing that, you won't loose any improvements to Members List in the future
Regards,
Tuan
Regards,
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.