Skip to Content Skip to Menu

🌲 Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with code XMAS-2024!

User defined profile title text

9 years 9 months ago #260573 by Andromeda57
User defined profile title text was created by Andromeda57
Hi guys,

we know, that we can use strings like [cb_username] in user defined profile title text.

Is it possible to use some kind of "if then" strings?

For example: If field cb_test is filled write it. If not write the filled cb_username ... ?


Greets
Tobias

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48616
  • Thanks: 8302
  • Karma: 1446
9 years 9 months ago #260594 by krileon
Replied by krileon on topic User defined profile title text
You'd use 2 substitution IF statements for that. Please see the below substitution tutorial for substitution usage information. IF substitution examples can be found at the bottom of the page.

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.

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

9 years 9 months ago #260702 by Andromeda57
Replied by Andromeda57 on topic User defined profile title text
Do not find an answer there...

What do we have to write for the following case...

If field A is empty (not filled by user) -> Write the username of the user.

If it is not empty (user filled with a value) -> Write the value


......

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 9 months ago #260708 by nant
Replied by nant on topic User defined profile title text

Andromeda57 wrote: Do not find an answer there...

What do we have to write for the following case...

If field A is empty (not filled by user) -> Write the username of the user.

If it is not empty (user filled with a value) -> Write the value


......


I do not understand why you say that Kyle's link did not help you with your task.

Did you read it?
Specifically the last section?

From the tutorial:
---
Ifs
[cb:if PARAMETER="REPLACEMENT"]TEXT/CODE[/cb:if]

[cb:if username="demo"]This is Demo being displayed.[/cb:if]
[cb:if user_id="myid"]This is Me being displayed.[/cb:if]
[cb:if user="#displayed" username="test"]This is Test being displayed.[/cb:if]
[cb:if user="#me" username="demo"]This is Demo watching.[/cb:if]
[cb:if user="#me" usertype="Super Administrator"]User of type: Super Administrator[/cb:if]
[cb:if user="#displayedOrMe" user_id<="0"]I am A GUEST.[/cb:if]
[cb:if user="#displayedOrMe" user_id>"0"]I am NOT A GUEST.[/cb:if]
[cb:if user="#me" username!="admin"]This is NOT Admin watching.[/cb:if]
[cb:if viewaccesslevel includes "1"]I am Public[/cb:if]
[cb:if viewaccesslevel !includes "1"]I am NOT Public[/cb:if]
[cb:if gids includes "2"]I have Registered Usergroup[/cb:if]
[cb:if gids !includes "2"]I do NOT have Registered Usergroup[/cb:if]
[cb:if username="demo" or username="admin"]This is Demo or Admin being displayed.[/cb:if]
[cb:if username="demo" and cb_country="USA"]This is Demo being displayed from the USA.[/cb:if]
---

This basically gives you the method.
If your field is cb_myfield, then you could use:

[cb:if cb_myfield=""]just the [username][/cb:if]
[cb:if cb_myfield!=""]Just the [cb_myfield][/cb:if]

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

9 years 9 months ago #260711 by Andromeda57
Replied by Andromeda57 on topic User defined profile title text
Yeah we read it and see that this should be the right syntax, but it didnt work.

We will try again and let you know.

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

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
9 years 9 months ago #260712 by nant
Replied by nant on topic User defined profile title text

Andromeda57 wrote: Yeah we read it and see that this should be the right syntax, but it didnt work.

We will try again and let you know.


Then please provide the code you used and how you tested and what the results are.

"it didn't work" is not very helpful to help you.

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

Moderators: beatnantkrileon
Powered by Kunena Forum