TOPIC:

List state in Conten template? 2 months 1 week ago #244687

  • Topic Author
  • jvkeller
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 111
  • Thanks: 0
Can I pull the List state text in to the content template?

ie. {state:text} ?

Attachments:

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

List state in Conten template? 2 months 1 week ago #244690

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1209
  • Karma: 3
  • Thanks: 109
Hi,

you can enable "Edit state" in your permission tab, and show in your CB list view.
Please check out this topic:
crosstec.org/en/support/online-documenta...use-list-states.html

Let me know if it helps.

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

List state in Conten template? 2 months 1 week ago #244753

  • Topic Author
  • jvkeller
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 111
  • Thanks: 0
I have that set and in the list view, but I would like to list the state in the record/template as well.

If you create samples, there is no view for state.

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

List state in Conten template? 2 months 1 week ago #244755

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1209
  • Karma: 3
  • Thanks: 109
Hi,

In your Content Prepare tab try to copy this:
$db =& JFactory::getDBO();

$result = '';

$query = "SELECT state_id from #__contentbuilder_list_records where record_id = '$record_id' AND form_id = 'X'";

$db->setQuery($query);

$result = $db->loadResult();

$query = "SELECT title from #__contentbuilder_list_states where id = '$result'";

$result2 = $db->loadResult();

$items["ITEMNAME"]["value"] = $result2;
Please replace "X" with your form_id, and ITEMNAME with your name of item in which you want to show state.

Let me know if it works for you.

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

List state in Conten template? 2 months 1 week ago #244892

  • Topic Author
  • jvkeller
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 111
  • Thanks: 0
I didn't have any luck with this.

Adjusted the code like so and addded to content prepare:
$db =& JFactory::getDBO();

$result = '';

$query = "SELECT state_id from #__contentbuilder_list_records where record_id = '$record_id' AND form_id = 'adoptablepets'";

$db->setQuery($query);

$result = $db->loadResult();

$query = "SELECT title from #__contentbuilder_list_states where id = '$result'";

$result2 = $db->loadResult();

$items["adoptable"]["value"] = $result2;

and added {adoptable:value} to the content template.

Did I miss understand something?

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

List state in Conten template? 2 months 1 week ago #244897

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1209
  • Karma: 3
  • Thanks: 109
Hi,

it seems you have added a form name as form_id, please replace 'adoptablepets' with your form_id.

Regards,
Tihana

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

Time to create page: 0.076 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!