We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Multi Text

Development and Programming

Mark Huot's avatar
Mark Huot
587 posts
16 years ago
Mark Huot's avatar Mark Huot

Ahh, didn’t a grade school teacher ever tell you “there’s no such thing as a stupid post”? I’m just glad I could help you out.

       
Ozmodiar's avatar
Ozmodiar
16 posts
16 years ago
Ozmodiar's avatar Ozmodiar

Nice extension! Would there be a way to make the name of the columns and name of the columns specific to custom fields?

For instance, I might want to use 2 “multi text” custom fields in the same entry, for 2 differnet things, and with 2 and 3 columns for instance ?!

       
Mark Huot's avatar
Mark Huot
587 posts
16 years ago
Mark Huot's avatar Mark Huot
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.

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

Is there any sort of {switch} I can use with this? Or should I use some sort of PHP modulo count?

       
Ryan M.'s avatar
Ryan M.
1,511 posts
16 years ago
Ryan M.'s avatar Ryan M.

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>
       
Mark Huot's avatar
Mark Huot
587 posts
16 years ago
Mark Huot's avatar Mark Huot

good solution mdesign, and you might mention PHP parsing has to be on output for this to work.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.
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…

       
Mr. Wilson's avatar
Mr. Wilson
131 posts
16 years ago
Mr. Wilson's avatar Mr. Wilson

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.

       
Brian M.'s avatar
Brian M.
529 posts
16 years ago
Brian M.'s avatar Brian M.

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?

       
Brian M.'s avatar
Brian M.
529 posts
about 16 years ago
Brian M.'s avatar Brian M.

I’ve got a bug using version 1.09 and EE 1.5.2 build 20070404 - I get some weird behavior in the CP.

The extension works properly when publishing, but when you go back to edit, it inserts an extra line between each entry.

       
Mark Huot's avatar
Mark Huot
587 posts
about 16 years ago
Mark Huot's avatar Mark Huot

Brian, I’m not seeing that in my install. Can you give me an example of the content you’re entering?

       
Brian M.'s avatar
Brian M.
529 posts
about 16 years ago
Brian M.'s avatar Brian M.

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.

       
Mark Huot's avatar
Mark Huot
587 posts
about 16 years ago
Mark Huot's avatar Mark Huot

That’d be great Brian because I can’t seem to replicate this.

       
Visiluna's avatar
Visiluna
92 posts
15 years ago
Visiluna's avatar Visiluna

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

       
Ronny's avatar
Ronny
83 posts
15 years ago
Ronny's avatar Ronny

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?

       
First 2 3 4 5 6 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.