Announcement

Collapse
No announcement yet.

Properties on Choices?

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

    Properties on Choices?

    Would it be possible (in a future Actinic 8 release) to allow choices to have their own properties?

    For example, if I have a product....say a 'packet of nodgers' that is available in two different sizes, 'big nodgers' and 'small nodgers'. A packet of big nodgers contains 10 (Note that this is a packet of big nodgers and not a big packet of nodgers) and a packet of small nodgers contains 20. I'd like to be able to add a variable NumberOfNodgersPerPack and set it for each choice.

    My current workaround is to use html (in the HTML for name box in the choice settings) to set the quantity as follows:

    !!<Large</td><td>Quantity 10>!!
    !!<Small</td><td>Quantity 20>!!

    (Note that the layout already contains the first set of open and close tags for the table cell.)

    This manually adds another column for quantity to the table but its messy, long winded and a nightmare to maintain/update.

    If variables were settable on choices I could code this to use a variable and clean it up considerably.

    Dave

    #2
    Actinic allows you to create special values and use them within the layouts. so the following is not fully experimented YET but you may try the following:
    • hit the design menu on the top of the system
    • then library
    • then the variables-tab
    • finally the Choice group
    • next copy the RadioButtonColumnCount variable to another one and call that "quantity" - generic and will now work with all choices not just nodgers
    • next give it the name, description, and prompt.
    • tick the "Place of setting" to "choice" - now appears in the choice
    • make sure you tick the "allow Empty Value" - means that not every choice needs this value set.
    • save and close this window.
    • next go to the actual product with the choice and you will see a new tab called "properties" containing the "quantity" variable (only available in Choices)
      you can set the value of your nodgers here
    • next you need to create a new layout for your choices
      this is set from the actual attribute level and will involve you creating a new layout. (probably again in library on the layout tab)


    you can copy the "Standard Radio Button Atribute" layout to your NEW layout and then you need to add a block condition.

    the condition being IF Quantity != "" then display the actual variable value

    I have played about with this concept within fragments where I have a "technical fragment" and I have the TechWords, TechValue and TechValue2 as variables and my new layout puts the extra code in to suit the values (if they have been entered)

    please note, I have NOT FULLY tested this concept, but the theory is there and it certainly works in fragments. including conditional display (if not null), conditional formatting and so on.

    Actinic have done quite a clever job here and made the system quite extensible and this MAY be a solution.

    see how you get on.

    kev

    Comment


      #3
      Thanks Kev.
      It almost works except that the new quantity variable is only settable in the product and not in each choice. So I can set a quantity value for the product 'Packet of Nodgers' but I cant set its value for the individual choices 'Packet of Nodgers - Small' and 'Packet of Nodgers - Large'.

      To use this I would have to split the product into two and have Small and Large as separate products but this would result in an awful layout for products that may have 10 of more different sizes.

      Comment


        #4
        I use PHP to examine the Choices HTML for Name field and generate different code, depending on what's there.

        This (untested) example looks for a semicolon in the Choices HTML for Name field and does some alternative processing on the bits before and after if found.

        In Design / Library / Layouts / Choices / Radio Button Choice

        replace

        <Actinic:Variable Name="ChoiceDisplayLabel"/>

        with

        Code:
        <actinic:block php="true" >
        $choicename = '<Actinic:Variable Name="ChoiceDisplayLabel" encoding="perl" selectable="false" />';
        // look for text;text in choice
        if ( preg_match('/(.*);(.*)/', $choicename, $choicebits) )
        	{
        	// put some real code here
        	echo $choicebits[1];	// the bit before the ;
        	echo $choicebits[2];	// the bit after the ;
                }
        else
        	{
        	echo $choicename;			// write out choice unaltered
        	}
        </actinic:block>
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          It almost works except that the new quantity variable is only settable in the product
          no not quite true, something seems to be wrong with your setup.
          I'm happily setting quantity for EACH choice (not product)
          my guess is that your problem lies in the "advanced place of setting" tab of the library settings.
          you need to click on "Choice" and then expand, then "Standard"
          I'm guessing that you've got "Product" ticked by mistake.
          This setting controls WHERE the custom value is prompted for and you need the value at CHOICE level.
          if you need screen shots, let me know.

          kev

          Comment


            #6
            Norman,
            Its an interesting way of acheiving the same results. it seems your quite happy playing in php/perl etc but a clever way of acheiving the same results.

            kev

            Comment


              #7
              Norman. Thanks for that bit of code. I think it's going to come in very handy. I've realised there are several other 'things' that I've done that could be a lot cleaner using PHP.

              Comment


                #8
                Kevin. How bizzare! I've just created a new product with component/attribute/choice and it has a GENERAL and a LAYOUT tab for the choice. The variable is settable on the LAYOUT tab.

                All my other products have no tabs but display the GENERAL tab content by default with no way of setting the variable.

                Comment


                  #9
                  I've attached a screen capture of various parts of the setup that I have created to do the job. ( I called my variable "qty" )
                  Once you go into the tabs etc, it should be obvious which part of my image you should be playing with.
                  see if that helps you.

                  kev
                  Attached Files

                  Comment


                    #10
                    Thanks Kevin, the problem I'm having seems to be elsewhere...The attached screenshot shows the problem I have...

                    Note the missing tabs..

                    Can someone from Actinic comment on this? Could this be something I've done?

                    Note I started this site using beta version of v8.
                    Attached Files

                    Comment


                      #11
                      this "choice" configuration seems a bit buggy.
                      I'm on 8.0.3 playing about. and I'm creating options fairly quickly.

                      don't ask me how the following has occurred, cos I can't work it out.
                      I've attached a screen-shot of various bits that have now appeared within the developer - trial edition 8.0.3.

                      looking at the scren shot - top left - I've suddenly aquired the same option TWICE - if I change the top one, , then apply the changes, pick another product, return to the problem one, the second attribute becomes the same as the first attribute.

                      moving to the top right image, ( CHOICE=8 ) I've correctly got the quantity value showing up on a new tab called "testTab"

                      moving to the bottom right image, ( CHOICE=9 ), and I've suddenly aquired a "layout tab" and I have not yet set the value of "qty" on "testtab" - not sure where its come from, but its clearly there.
                      If I delete choice 9 altogether, then the layout-tab returns on the new choice I go on to create, - most peculiar

                      finally, back to the bottom right image, ( CHOICE=10 ) and we've lost the layout tab and its all back to normal. (no layout tab)

                      from now on, if I create a new choice, initially the layout tab is missing, but if I apply changes, and then return to the choice, the layout tab is back with us again.

                      I've tried saving the snapshot and re-opening to no avail.

                      comment time from actinic I guess.

                      Dave - at the moment, I can't help much more - sorry
                      Attached Files

                      Comment


                        #12
                        Kevin,
                        Thanks for that. The choice configuration certainly seems to have some teething troubles. Hopefully this will go away in the next production release. At least I know that what I want to do is achievable in theory if not yet in practice.

                        Dave

                        Comment


                          #13
                          Adding a variable to each choice works fine for me. I've posted http://community.actinic.com/showthr...141#post126141 to shows how to use this to display an optional image per choice. It would be trivial to change this to display a bit of text instead.
                          Norman - www.drillpine.biz
                          Edinburgh, U K / Bitez, Turkey

                          Comment

                          Working...
                          X