We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50272
    • 89 Posts
    Hi Folks

    All I'm trying to do is give the client (an artist), when editing his site,
    the choice of selecting the status of each of his images: 'POA', 'NFS' or 'SOLD'
    Those three options should read on the front end as:
    POA: "POA"
    NFS: "NFS"
    SOLD: a red dot

    Obviously the first two are very simple, but it's incorporating the third option: the red dot,
    that's giving me the pain.

    I have tried all ways to achieve this...
    By simply using the HTML characters like
    $bullet (ampersandbullet)
    results in a right headache with my css and layout.

    Therefore I was trying to incorporate both straightforward text for the first two, POA and NFS (probably via css),
    and the third (red dot) by way of either:

    1. An icon tag i.e.
    <i class="fi-dot"></i>

    2. Some styling i.e.
    .sold:after {content: ""...followed by a css-generated red circle)

    3. Adding a small svg file



    I have tried...
    Setting a small style block in the head which calls the tv (or at least that's what I'm attempting)
    i.e.
    .poa::after, 
    .nfs::after, 
    .sold::after {content:"[[!*image-status]]";}
    

    (those options being called from '*image-status' would obviously be css styles)

    I have tried...
    Hard coding the css into the 'Input Option Values' field of a TV

    I have tried...
    Creating three individual chunks, one for each status,
    and then, from '*image-status' calling them via the 'Input Option Values' field using the @CHUNK binding


    Is it even possible to call other TV's from this field? i.e.
    '*image-status' > 'Input Option Values': POA==*status_poa||NFS==*status_nfs||SOLD==*status_sold


    Is it possible to mix the TV types, say within an overall MIGX setup?

    I've tried so many combinations that I've wandered off the beaten track and now I'm lost and it's getting dark!

    If anyone could bring a torch (flashlight) and a fresh eye and perhaps suggest a simple way forward here,
    I'd be most grateful.

    Many thanks
    Chris


    My setup:
    MODX latest (2.6.3)
    MAMP (4.3)
    PHP (7)
    MySQL (5.6.38)
    Chrome: Safari: FF (latest versions)
    MacOS Sierra 10.12.6

    This question has been answered by BobRay. See the first response.

    [ed. note: geordiechris last edited this post 5 years, 11 months ago.]
    • discuss.answer
      • 3749
      • 24,544 Posts
      I think I would hard-code the HTML into the TV options:

      POA==<span class="status_poa">POA</span>||NFS==<span class="status_nfs">NFS</span>||SOLD==<span class="status_sold"> </span>


      (Note that the last span is empty except for a space)

      Then in your CSS, you can give each class a font, height, width, margins, padding, etc., and in the case of .status_sold, a background URL with the dot.



        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 50272
        • 89 Posts
        Worked a treat Bob.
        I think perhaps I was overthinking things a tad.
        Many thanks
          • 3749
          • 24,544 Posts
          Easy to do. It happens to me all the time.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting