ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

P&T Pill

June 15, 2011 2:04pm

Subscribe [1]
  • #1 / Jun 15, 2011 2:04pm

    Evolve Websites

    110 posts

    THis may be a simple one, but can anyone tell me how to use the P&T Pill fieldtype?

    My code is currently as follows:

    {exp:channel:entries channel="testimonials"}
                                    <div class="test-content">
                                        <div class="test-highlight">
                                            <h2>{quote_snippet}</h2>
    <p>                                    </div><!-- /end #test-highlight --><br />
                                        {quote_complete}<br />
                                        {title}<br />
                                    </div end><!-- /end #test-content --><br />
                                    {/exp:channel:entries}

    I’ve added a P&T Pill fieldtype (left-right-column) to the testimonials entries, that simply says Left Column or Right Column

    What I’d like to do is display two lists (i.e. left and right column) and simply place something in the code on the left column to say only display testimonials entries with left column seleceted and vica versa for right column.

    Any ideas?

    Thanks in advance,

    Tom Perkins

  • #2 / Jun 15, 2011 2:21pm

    P&T Pill just spits out the field’s selected value.  You could use said value as a CSS class(es), and something like this should do the trick…

    Template:

    <div class="{left-right-column}">Whatever you want to display on the right or the left.</div>

    CSS:

    .Left.Column{ float: right; }
    .Right.Column{ float: left; }
  • #3 / Jun 15, 2011 3:26pm

    Evolve Websites

    110 posts

    Thanks Nick.

    Does anyone know a way to display all entries with that class (i.e. left column) using an expression engine tag, or using PHP?

    Something like ‘left-right-column =left column’, but in PHP?

  • #4 / Jun 15, 2011 4:01pm

    Take a look at the search attribute.

    We typically use a custom status in situations like this, rather than the value of a field.  That gives you a little more flexibilty in the control panel and with a few plugins.

  • #5 / Jun 16, 2011 6:30am

    Evolve Websites

    110 posts

    Great, thanks Nick!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases