We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • discuss.answer
    • 4172
    • 5,888 Posts
    try this snippet:

    <?php
    
    $options = $modx->getOption('options',$scriptProperties,'');
    $outputSeparator = $modx->getOption('outputSeparator',$scriptProperties,'');
    
    $properties = array();
    $outerproperties = array();
    $output = array();
    
    if (trim($options) != ''){
        $options = str_replace(',','||',$options);
        $options = explode('||',$options);
        foreach ($options as $option){
            $parts = explode('==',$option);
            $properties['text'] = $parts[0];
            $properties['value'] = isset($parts[1]) ? $parts[1] : $parts[0];
            $output[]= $modx->getChunk($tpl,$properties);
        }
        $outerproperties['options'] = implode($outputSeparator,$output);
        $output = $modx->getChunk($outerTpl,$outerproperties);
        return $output;    
    }
    


    call it:

    [[prepareOptions? 
    &options=`[[*property-specification]]`
    &outerTpl=`tplSpecOuter`
    &tpl=`tplSpec`
    ]]


    tplSpecOuter
    <h3>Specifications</h3>
    <ul class="specifications">
        [[+options]]
    </ul>
    


    tplSpec
    <li>[[+text]]</li>


    [ed. note: Bruno17 last edited this post 13 years, 5 months ago.]
      -------------------------------

      you can buy me a beer, if you like MIGX

      http://webcmsolutions.de/migx.html

      Thanks!
      • 16899
      • 284 Posts


      Hi Bruno

      First of all, i really appreciate the time you are spending to try to help me!!! I really appreciate that! Thanks a lot!

      I did all your steps and i think this is nearly there... for some reason the option values are not using the tplSpec, check the output below.

      <ul class="specifications">
          <li>Air conditioningAutomatic irrigationBBQBoreholeCar portDouble glazingDrive wayElectric entrance gateEquipped kitchenFenced plotFitted wardrobesFurnishedHeatingLandscaped gardensLiving/dining roomMosquito netsOpen plan living areaQuiet LocationSatellite TVSecurity alarmStorage / Utility roomTerraceWater CisternWood burner</li>
      </ul>


      Then if no options keep showing me the below code

      <h3>Specifications</h3>
      <ul class="specifications">
          <li></li>
      </ul>


      Thanks a lot matey!!! smiley
        • 4172
        • 5,888 Posts
        changed the code a bit. Does it now?
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 16899
          • 284 Posts
          Quote from: Bruno17 at Apr 23, 2013, 06:11 AM
          changed the code a bit. Does it now?

          Almost there... if the TV has no options is working perfectly, but if it has options does this, instead of separate one option in a diferent LI, wrap all options in one single LI

          <h3>Specifications</h3>
          <ul class="specifications">
              <li>Air conditioningAutomatic irrigationBBQBoreholeCar portDouble glazingDrive wayElectric entrance gateEquipped kitchenFenced plotFitted wardrobesFurnishedHeatingLandscaped gardensLiving/dining roomMosquito netsOpen plan living areaQuiet LocationSatellite TVSecurity alarmStorage / Utility roomTerraceWater CisternWood burner</li>
          </ul>

            • 4172
            • 5,888 Posts
            make the output-format for your TV delimited and use , or || as delimiter.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 16899
              • 284 Posts
              Quote from: Bruno17 at Apr 23, 2013, 07:01 AM
              make the output-format for your TV delimited and use , or || as delimiter.

              Yeeeeeeeeeeeeeeeeeeessssssssssssssssssssssssss! It´s working!!!!! Thanks a lot for your help matey!!!! You´re the master!!!! smiley
              Thanks a lot to all of you guys who tried to helped me with this!!!!! smiley

              By the way... some days ago, i´ve opened a post with other situation... but no one gave me some "light" how to solve, probably, a simple problem!!! As this post is beeing active, i´ll put here my other question link, to see if someone can help me with that!! But again, thanks a lot for this!!! smiley

              https://forums.modx.com/thread/83975/advsearch---queryhook-to-search-on-price-ranges#dis-post-463514 [ed. note: legues last edited this post 13 years, 5 months ago.]