For a little more control replace the number of columns with a space and the labels with a space. Then in the edit field page change the field type to a text field and enter the number of columns you would like in the textarea rows. Then change it to a drop-down list and enter your labels in the drop down list box. Finally change the field back to a multi text and you’re done. Field specific settings.
from the first post in the thread, the functionality is built in by default.
For the record, I got this “switch” to work with multi-text. I put a sample here in case it might help anyone else out. Note that PHP has to be on for the template.
<ul>
<?php
$count = 0;
$rowclass='';
?>
{my_multitext_field}
<?php
$count++;
if($count % 2) {
$rowclass = 'even';
} else {
$rowclass = 'odd';
}
?>
<li class="<?php echo $rowclass; ?>">{col_1} - {col_2}</li>
{/my_multitext_field}
</ul>
good solution mdesign, and you might mention PHP parsing has to be on output for this to work.
Any easy way to get that to work with PHP parsing on input? I’ve got other PHP that has to be processed on input on the same page I’d like to use this tag with alternating row colors…
Switchplus might be able to help you out if you want to avoid PHP in your templates, or if you run into an input/output problem like The Pie Man.
Thanks Mr. Wilson - I’ll have to check that out.
Here’s a question. I’ve got the following code:
{board_committee_members}
<tr>
<td><strong>{col_1}</strong></td>
<td>
{exp:query sql="SELECT url_title AS link from exp_weblog_titles WHERE title='{col_2}' AND weblog_id='5' limit 1"}
<a href="http://{path=pages/member_directory_detail}{link}">{col_2}</a>
{if no_results}
{col_2}
{/if}
{/exp:query}
</td>
<td>{col_3}</td>
<td>{col_4}</td>
</tr>
{/board_committee_members}
Which works well if there’s an entry in the database, but the {if no_results} isn’t getting parsed. Is there some way around that?
It’s just text in a 2 column multi-text field. There’s a column for ‘name’ and one for ‘company’. Here’s the first three entries:
Lawrence K. Barber Merrill Lynch Sylvia Blanchet ForesTrade, Inc. Jan Blittersdorf NRG Systems, Inc.
I can PM you a login if you’d like to see it happening.
I have created a matrix of four columns. If a column is left empty on any row, it treats the next column as though it is the first column of the next row.
EXAMPLE
The columns for a given entry might be stored like this:
Name_1
Title_1
Email_1
Phone_1
Name_2
Title_2
Phone_2
Name_3
Title_3
Email_3
Phone_3
But when they are rendered using
{exp:weblog:entries}
{my_field}
Name: {col_1}
Title: {col_2}
Email: {col_3}
Phone: {col_4}
{/my_field}
{/exp:weblog:entries}
It appears like this:
Name: Name_1
Title: Title_1
Email: Email_1
Phone: Phone_1
Name: Name_2
Title: Title_2
Email:
Phone:
Name: Email_2
Title: Phone_2
Email:
Phone:
Name: Name_3
Title: Title_3
Email: Email_3
Phone: Phone_3
Any ideas on making this allow empty columns? Some of my entries won’t have data in every column.
Thanks, Philip Jones
Just a small question: My version is 1.0.8 and I believe I should update to improve some speed-issues.
During the development of the site, I had another update as well. But because I have a 2 column layout, and the extension has standard a 3 column layout, the data looked out of place in the ACP. Is there something in the extension I could change to make sure I keep the 2 column layout?
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.