Announcement

Collapse
No announcement yet.

True/False = "1" or "0" in filtering

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    True/False = "1" or "0" in filtering

    Hi - I have set up a filter based on the type True or False. Works fine, but on-screen the choice is displayed as "1" or "0" = not very user friendly. I have used the additional "values" tab to define "yes" and "no" but these seem to be ignored.

    How can I make the sellerdeck system display "Yes" or "No" on the web page instead of "1" or "0" ?

    #2
    as a fudge change the type to "Choice" and in the values set up "Yes" and "No" ... as well as "N/A" as a get out option


    Bikster
    SellerDeck Designs and Responsive Themes

    Comment


      #3
      Thanks for the reply. I was hoping not to have to re-visit every product. This must be a bug really as no-one would ever want "1" and "0" displayed. Any input Sellerdeck ?

      Comment


        #4
        Lets try to fix this. Go to Design / Library / Layouts / Filter Property Values / Filter Property Checkbox.
        At the bottom of this layout is:
        Code:
        <label for="<actinic:variable name="FilterPropValueName" />-<Actinic:Variable Name="ListIndex"/>">
        	<actinic:variable name="FilterPropText" /><actinic:variable name="FilterResultCount" />
        </label><br/>
        Replace with:
        Code:
        <label for="<actinic:variable name="FilterPropValueName" />-<Actinic:Variable Name="ListIndex"/>">
        	<actinic:block if="%28%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%21%3d%20%270%27%29%20AND%20%28%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%21%3d%20%271%27%29" ><actinic:variable name="FilterPropText" /></actinic:block>
        	<actinic:block if="%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%3d%3d%201" >Yes</actinic:block>
        	<actinic:block if="%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%3d%3d%20%270%27" >No</actinic:block>
        	<actinic:variable name="FilterResultCount" />
        </label><br/>
        N.B. Only lightly tested. Please report if it works or not.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Hi there - many thanks for that. I tried it but nothing changed. Here is my code of the layout
          <Actinic:StaticSearchField>
          <input type="checkbox"
          name="<actinic:variable name="FilterPropValueName" />"
          value="<actinic:variable name="FilterPropValue" />"
          <actinic:block if="%3cactinic%3avariable%20name%3d%22IsDefaultFilterProperty%22%20%2f%3e" >checked="checked"</actinic:block>
          id="<actinic:variable name="FilterPropValueName" />-<Actinic:Variable Name="ListIndex"/>"
          />
          </Actinic:StaticSearchField>
          <Actinic:SearchField actualtag="input" type="checkbox"
          name="<actinic:variable name="FilterPropValueName" />"
          value="<actinic:variable name="FilterPropValue" />"
          <actinic:block if="%3cactinic%3avariable%20name%3d%22IsDefaultFilterProperty%22%20%2f%3e" >checked="checked"</actinic:block>
          id="<actinic:variable name="FilterPropValueName" />-<Actinic:Variable Name="ListIndex"/>"
          >
          </Actinic:SearchField>
          <label for="<actinic:variable name="FilterPropValueName" />-<Actinic:Variable Name="ListIndex"/>">
          <actinic:block if="%28%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%21%3d%20%270%27%29%20AND%20%28%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%21%3d%20%271%27%29" ><actinic:variable name="FilterPropText" /></actinic:block>
          <actinic:block if="%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%3d%3d%201" >Yes</actinic:block>
          <actinic:block if="%3cactinic%3avariable%20name%3d%22FilterPropText%22%20%2f%3e%20%3d%3d%20%270%27" >No</actinic:block>
          <actinic:variable name="FilterResultCount" />
          </label><br/>
          I still get the "1" and "0" instead of yes/no. I uploaded.
          In test mode here: http://www.mowermagic.co.uk/cgi-bin/...awnMowers.html

          Comment


            #6
            The Yes / No is briefly appearing but then disappears when the JavaScript that maintains the search/filtering kicks in. Looks like the JavaScript needs tweaking too.

            Edit actinicsearch.js (in your Site folder - back it up first). Look for the line:
            Code:
            	var sLabelText =  sArrayChoices[nChoiceInx].m_sChoiceName;
            After it add the lines:
            Code:
            	if ( sLabelText == '0' ) sLabelText = 'No';
            	if ( sLabelText == '1' ) sLabelText = 'Yes';
            Note that you will need to re-do this if you upgrade SD to a new version as the script files usually get replaced with fresh copies.

            Again, test and report if it works for you.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


              #7
              Great Stuff - I can confirm this works now. Many thanks !

              Comment


                #8
                Great. Bear in mind that this will alter any prompts that are 0 or 1. So if you had a prompt like Number of Rollers, that could be compromised.
                Norman - www.drillpine.biz
                Edinburgh, U K / Bitez, Turkey

                Comment

                Working...
                X