Skip to Content Skip to Menu

[SOLVED] field meta description

  • escalona
  • escalona
  • OFFLINE
  • Posts: 113
  • Thanks: 5
  • Karma: 1
10 years 5 months ago - 10 years 3 months ago #245318 by escalona
[SOLVED] field meta description was created by escalona
Hello:
As I can do to use a text field as meta description in userprofile page?
Regards.
Last edit: 10 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245371 by krileon
Replied by krileon on topic field meta description
You'll need to use CB Auto Actions and its Code action then set Method to Header. This will allow you to add custom HTML to the page header, which could be a meta description with your field as the substitution.


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 or Create an account to join the conversation.

  • escalona
  • escalona
  • OFFLINE
  • Posts: 113
  • Thanks: 5
  • Karma: 1
10 years 5 months ago #245381 by escalona
Replied by escalona on topic field meta description
Thanks for your help.
But, excuse me, I need a little more help. I need to put the meta description in the user profile pag
Post 2 screen. Please correct what is wrong.
Thanks
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 5 months ago #245401 by krileon
Replied by krileon on topic field meta description
Your trigger isn't valid or correct and your code isn't an HTML header. Please see the below example.

Type: Code
Triggers: onBeforeUserProfileDisplay
Access: Everybody
Method: Header
Code:
Code:
<meta name="description" content="[FIELD_NAME]" />

Replace FIELD_NAME with the actual name of the field you want to substitute in. Please see the below tutorial for further substitution usage information.

www.joomlapolis.com/support/tutorials/107-use-cases/18353-using-substitutions-throughout-cb


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: SITOLOGUE

Please Log in or Create an account to join the conversation.

  • SITOLOGUE
  • SITOLOGUE
  • OFFLINE
  • Posts: 46
  • Thanks: 4
  • Karma: 0
10 years 3 months ago #246734 by SITOLOGUE
Replied by SITOLOGUE on topic field meta description LIMIT
Hi

Your code works well, thanks, but how can I limit the description to 120 characters
I not successful a insert in addition to php in the header for this

thanks

manuel

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #246744 by krileon
Replied by krileon on topic field meta description LIMIT
You would need to use PHP for that. Example as follows uses CBs document API to add metadata to the header.

Type: Code
Triggers: onBeforeUserProfileDisplay
Access: Everybody
Method: PHP
Code:
Code:
global $_CB_framework; $_CB_framework->document->addHeadMetaData( 'description', substr( '[FIELD_NAME]', 0, 120 ) );


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: nant

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum