Skip to Content Skip to Menu

Problem display DATE

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
6 years 4 weeks ago - 6 years 4 weeks ago #307579 by chanteur94
Problem display DATE was created by chanteur94
Hi

I create 2 fields DATE , cb_date1 and cb_date2, with personalised format date m-Y (edit and display for the two fields)
It works fine when I use these fields normally.

But i want to display cb_date1 / cb_date2 in the layout of date1

If for example I have date1 = 05-2017 and date2 = 08-2017

I put : [value] / [cb_date2] -> i have : 05-2017 / 2018-10-01

I put : [value] / [cb:userfield field="cb_date2" /] -> I have 05-2017 - nothing

I put : [value] / [cb:userdata field="cb_date2" /] -> I have 05-2017 / 2018-10-01

So , how can I have : 05-2017 / 08-2017

Thank you.
Last edit: 6 years 4 weeks ago by chanteur94.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
6 years 4 weeks ago #307583 by krileon
Replied by krileon on topic Problem display DATE
[FIELD_NAME] and [cb:userdata field="FIELD_NAME" /] are the same except userdata lets you specify parameters. Neither respect display parameter for a field. So if a field is set to not display on profile both those usages will still display it, but it will have no formatting as it outputs the raw value. [cb:userfield field="FIELD_NAME" /] will have formatting, but will also respect display parameter and permissions. To use [cb:userfield field="FIELD_NAME" /] you need to be sure the field is set to display on profile. If you don't want it actually displayed then be sure to move it to a tab in a not shown on profile position.


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.

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
6 years 4 weeks ago #307586 by chanteur94
Replied by chanteur94 on topic Problem display DATE
Thank you for the answer but I use [cb:userfield field="FIELD_NAME" /] and I'm sure the field is set to display on profile.

The result is empty.

Another idea ?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
6 years 3 weeks ago #307611 by krileon
Replied by krileon on topic Problem display DATE
Move the field to a tab that does show on profile then check the users profile and see if you can see the field. If you can't then you won't be able to substitute it in with [cb:userfield field="FIELD_NAME" /]. It could be hidden as result of a condition from CB Conditional, privacy controls in CB Privacy, or display parameters on the field it self.


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.

  • chanteur94
  • chanteur94
  • OFFLINE
  • Posts: 302
  • Thanks: 13
  • Karma: 1
6 years 3 weeks ago #307625 by chanteur94
Replied by chanteur94 on topic Problem display DATE
In fact, I forget to say something important : my 2 dates field are in a field group !!!!
Without field group, all is fine.

With the field group, I have always the problem. (No conditionnal or privacy controls...)


I

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8277
  • Karma: 1443
6 years 3 weeks ago #307642 by krileon
Replied by krileon on topic Problem display DATE
You might, and this is a BIG might, be able to do that by structuring the field name in the substitution as follows.

FIELDGROUPNAME_INDEX_FIELDNAME

Example as follows.

cb_myfields_0_cb_date

This should display the cb_date field in the first row of the cb_myfields field group. Use 1 for second row, 2 for 3rd, etc.. This may only work with raw substitutions output (e.g. [cb_myfields_0_cb_date]).

If that doesn't work your best option is to just create a new template for the CB Fields Group plugin that outputs the repeated groups however you like. You can find the template files at the below location. Several examples are already included that do partial replacements (e.g. list, tag, and table).

/components/com_comprofiler/plugin/user/plug_cbfieldgroups/templates


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