JOIN question... I think

28 posts by 6 authors in: Forums > CMS Builder
Last Post: July 19, 2011   (RSS)

By Jason - March 8, 2011

Hi,

You many not need to do a join at all. What type of field is team_home and team_away? Are they list fields?

If so, and if you're using CMS Builder version 2.04 or higher, you can use the :label pseudo field to output the list fields label instead of it's value (ie, the name rather than the number).

It would look like this:

<?php echo $record['team_home:label']; ?>

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] JOIN question... I think

By mbareara - March 12, 2011

Thank you for your reply :D

but it doesn.'t work

I receive this error Notice: Undefined index: articoli_correlati_1:label in /home/....... on line 206

This is my code
<?php if ($record['articoli_correlati_1']): ?>
<ul>
<li><?php echo $record['articoli_correlati_1:label']; ?></a>
</li>
</ul>
<?php endif ?>

By Jason - March 14, 2011

Hi,

What type of field is articoli_correlati_1? What version of CMS Builder are you using?

Let me know.
Thanks
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] JOIN question... I think

By zip222 - July 19, 2011

I am having this issue as well. undefined variable when using the :label pseudo field.

It is with a "list" field type
getting options from database (advanced)
- option values: num
- label values: title

Re: [zip222] JOIN question... I think

By zip222 - July 19, 2011

So I think I now know why this is happening... my list is multi-value checkbox. If I use a single-value pulldown it works fine. Any way around this?

Re: [Jason] JOIN question... I think

By zip222 - July 19, 2011

If I use :labels it just gives me the word "Array".... ?

Re: [zip222] JOIN question... I think

By Jason - July 19, 2011

Hi,

:labels isn't a single value, but an array of values. For example, if you wanted to output all the labels as a comma separated list, you could do this:

<?php echo join(",", $record['field:labels']); ?>

Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/