5

We're integrating a new client site that has a rather unique need. We have a matrix field with two columns. The second column needs to be output in the template in a list format (LI tags). Originally we planned on integrating P&T List for the second column but we found that it doesn't allow carriage returns, which is another requirement.

Here's the template we'll be integrating:

http://www.itistic.com/projects/radiologyassociates/html/radiologists/kedar.asp

We're using Matrix to output custom designations for each radiologist. In the page above, the USF Associate Professor list would be an example of a custom designation. So in our Custom Designations Matrix field we'd have the following columns:

USF Associate Professor   |   - Body Imaging
                              - Musculoskeletal

.. and here's another example:

http://www.itistic.com/projects/radiologyassociates/html/radiologists/feldman.asp

In this entry, the Cross Sectional Imaging Fellowship would be a custom designation that's input via this Matrix field. You can see here that we need the ability to do line breaks/carriage returns in a single list item.

Cross Sectional Imaging Fellowship   |   - Mayo Clinic
                                           Jacksonville, FL
                                           Body Imaging

Any options?

2
  • Shawn, was there a correct answer to this question posted?
    – Anna_MediaGirl
    Dec 12, 2012 at 5:16
  • 1
    Yes, Anna. Sorry - just marked the answer I ended up using now :)
    – ShawnCBerg
    Jan 16, 2013 at 17:40

3 Answers 3

10

Markdown is probably worth considering, although users would familiarise themselves with the two-trailing-spaces linebreak behaviour, which isn't exactly intuitive.

If you're using WYSIWYG fields elsewhere that's also an option. For example, you could easily setup a Wygwam editor config which only has the bulleted list control enabled. That would be crazy-simple and fairly robust, as users aren't going to start screwing around with other controls that might make a mess of the layout.

5
  • I like the WYSIWYG approach! Hadn't even thought about that. Great idea!
    – ShawnCBerg
    Nov 17, 2012 at 4:05
  • 1
    Tip: If you were to use Wygwam you could set up a custom WYSIWYG layout which only has bullet points and no other controls which may leave your page a bit fugly looking.
    – Mutual
    Nov 18, 2012 at 14:36
  • @AndieFairlie That's exactly what I suggested.
    – Dom Stubbs
    Nov 18, 2012 at 17:07
  • @DomStubbs so you did! Sorry!!
    – Mutual
    Nov 18, 2012 at 17:13
  • @AndieFairlie No worries. Great minds, etc.
    – Dom Stubbs
    Nov 18, 2012 at 17:17
6

Not the best though, maybe use 3 columns:

Then do something like the following:

<ul>
    {your_matrix_field}
        <h3>{mx_text_title}</h3>

        {if mx_nolan_items}
            <ul>
                <li>
                    {!-- single line so our backspace isn't having to count blank spaces --}
                    {mx_nolan_items backspace='4'}{nolan_item}<br>{/mx_nolan_items}
                </li>
            </ul>
        {/if}

        {if mx_ptlist_items}
            {mx_ptlist_items}
        {/if}

    {/your_matrix_field}
</ul>

Make sure you explain in the field directions or via NSM Publish Hints that they should only use the list or the nolan for each row. So only one or the other vs both at once.

1
  • Never knew about Nolan. Looks to be a useful add-on. Thanks for the suggestion!!
    – ShawnCBerg
    Nov 17, 2012 at 4:06
2

Are you using Low Variables? you can put a low variable, which contains a matrix field, inside a matrix and that would theoretically give you the list that you need inside that cell. I haven't tried this myself, but it should work.

Alternatively you could check out Nolan, which lets you have a simple matrix inside a matrix.

1
  • Never knew about Nolan. Looks to be a useful add-on. Thanks for the suggestion!!
    – ShawnCBerg
    Nov 17, 2012 at 4:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.