field outputs as a number

7 posts by 3 authors in: Forums > CMS Builder
Last Post: August 10, 2010   (RSS)

By Joseph - August 8, 2010

Hi

Not sure what i am doing wrong but on this page - http://www.socanews.com/masbands/indexTest.php?country_keyword=united+kingdom i am trying to out put the name of the theme instead i get a number. How would i go about changing this? Thanks Joseph

This the portion of code that the theme resides in:

<?php foreach ($masbandsRecords as $masbands): ?>
<?php foreach ($masbands['image'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" style="padding: 5px 10px 5px 5px" /><br/>
<?php break; ?>
<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" style="padding: 5px" /><br/>
<?php break; ?>
<?php endif ?>
<?php endforeach <a href="<?php echo $masbands['_link']; ?>" class="articleContentBold"><?php echo $masbands['title']; ?></a><br/>
Theme: <?php echo $masbands['theme']; ?><br/>
<span class="articleContentDateBold"><?php echo $record['title'] ?> | <?php echo $masbands['type']; ?> | <a class="articleContentDateBold" href="<?php echo $masbands['_link']; ?>">More Info</a></span> </td>
</tr>
<tr>
<td colspan="2" bgcolor="#C0DEED"><img src="/_images/site/spacer.gif" width="1" height="15" /></td>
</tr>
<?php endforeach; ?>

Re: [socanews] field outputs as a number

By Jason - August 9, 2010

Hi,

If you are using CMS Builder version 2.04 or higher, you can use Pseudo fields to display the label of a field that's stored as a number.

In your case, trying this:

Theme: <?php echo $masbands['theme:label']; ?><br/>

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] field outputs as a number

By Joseph - August 9, 2010

Hi Jason

Thanks for your reply I made the change as suggested but now nothing at all shows up http://www.socanews.com/masbands/indexTest.php

Joseph

Re: [socanews] field outputs as a number

By Jason - August 9, 2010

Hi Joseph,

Could you tell exactly how you're storing the field "theme" in the database? I'm assuming it's a drop down field that is pulling information from another table. What are the label and value fields?

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] field outputs as a number

By Joseph - August 9, 2010

Hi Jason

the Theme field is working with another the Section Editor Mas bands.

Under mas bands i have set up a list field to pull information from the Themes Section Editor if one exsist for the masband. i have attached a screen print of how i this has been set up.
Attachments:

themes-list.jpg 45K

Re: [socanews] field outputs as a number

By Jason - August 10, 2010

Hi Joseph,

If you can fill out a Second level support request here:
http://www.interactivetools.com/support/

We can go in and take a closer look at the problem.

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/