add open graph tags on the fields

3 years 11 hours ago #324526 by jlmo
Replied by jlmo on topic add open graph tags on the fields
Here is the account with which I have the license. I asked my friend to take the license directly for his site. I just give her a hand

Please Log in to join the conversation.

2 years 11 months ago #324535 by krileon
Replied by krileon on topic add open graph tags on the fields
The method for the clean format function specifies what it's cleaning to. Not what it's removing. So with method="html" it's filtering out unsafe HTML leaving safe HTML behind. To filter to a string with no HTML you need to use method="string". Specifically the below should work.

[cb:parse function="clean" method="string"][cb_experienceprofessionnelle][/cb:parse]

I'd probably take this a step further and apply htmlspecialchars as well. You should be able to do this using the below.

[cb:parse function="htmlspecialchars" string="[cb:parse function="clean" method="string"][cb_experienceprofessionnelle][/cb:parse]" /]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: jlmo

Please Log in to join the conversation.

2 years 11 months ago - 2 years 11 months ago #324590 by jlmo
Replied by jlmo on topic add open graph tags on the fields
Hello and thank you for your help.
I don't know if the problem is there. So I went back with the "header" method of the code:
<meta property="og:description" content=" [cb_experienceprofessionnelle]" />
<meta property="og:image" content=" [avatar]" />

My problem is that part of my og: description tag appears at the very top of the site with "/> at the end
This tag uses the content of the "Professional experience" field found further down in the body of the page
www.coaching-sante.net/component/comprofiler/userprofile/706-blanchet.html?Itemid=211

In fact the problem is encountered as soon as there is an url in the content of my field. I don't see how to delete its urls

This does not work, it just displays the entire field visible above the menu
[cb:parse function="clean" method="string"][cb_experienceprofessionnelle][/cb:parse]
thank you for your help

Please Log in to join the conversation.

2 years 11 months ago - 2 years 11 months ago #324594 by krileon
Replied by krileon on topic add open graph tags on the fields
That's why I suggested above that you should also likely be applying htmlspecialchars. Try the following.

<meta property="og:description" content="[cb:parse function="htmlspecialchars" string="[cb:parse function="clean" method="string"][cb_experienceprofessionnelle][/cb:parse]" /]" />

Will review adding a new Method for Code action that lets you just supply keys and values and will have it internally deal with the cleaning and escaping process. That should make it easier in the future.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

2 years 11 months ago #324597 by jlmo
Replied by jlmo on topic add open graph tags on the fields
Thank you
but it does not work now I have a lot more text above that is displayed and on all the people
you can look

Please Log in to join the conversation.

2 years 11 months ago #324598 by krileon
Replied by krileon on topic add open graph tags on the fields
Looking at your site it doesn't look like you turned on format functions. The following is what you should have exactly and works fine in my tests.

Action
Method: Header
Code:
<meta property="og:description" content="[cb:parse function="htmlspecialchars" string="[cb:parse function="clean" method="string"][cb_experienceprofessionnelle][/cb:parse]" /]" />
Parameters
Substitutions: Yes
Format Functions: Yes


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: jlmo

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.200 seconds

Facebook Twitter LinkedIn