Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How can I customize attribute labels after BYO section in ACBC?

Post-BYO we collapse several attributes into a couple of different conditional displays.  I understand that I can customize the label of the that conditional display if I don’t replace an existing attribute, but then I lose the ability to place that conditional display in it’s proper order within the concept (I have to choose either top or bottom).  If I replace the existing attribute, then I can’t customize the label (it uses the label of the attribute it is replacing, which in this case is not appropriate for the collapsed variable we’re trying to show).

So, we’d like to customize some attribute labels to be different from what is seen in the BYO (preferrable), or, if necessary, figure out how to place the conditional displays somewhere other than either top or bottom if they are not replacing an existing attribute.

Thanks.
asked Apr 29 by gretchenh (200 points)

1 Answer

0 votes
 
Best answer
We could do this your first or second way.  For the first way, I'd start by changing your attribute label to something like this:

<span class="byoText">my byo label</span>
<span class="nonByoText">my other label</span>


Then place this in our BYO question:

<style>
.question.acbc_byo .nonByoText {
    display: none
}
</style>


And this in our non-BYO questions:

<style>
.question:not(.acbc_byo) .byoText {
    display: none
}
</style>
answered Apr 29 by Zachary Platinum Sawtooth Software, Inc. (182,000 points)
selected Apr 30 by gretchenh
Thank you, Zachary, it's the perfect solution.  Appreciate the help!
Dear Zachary,

I want to do quite the same thing as discussed above, i.e., the attribute levels in the BYO section should be more detailed than in the Screening, Tournament and Calibration section.

Your syntax works perfectly. However, I have encountered one problem: In my BYO section it now displays the detailed description as well as the shortened description for all attribute levels.

Example:
In Lists I have added the predefined list Breathability with the list member
<span class="byoText">Low breathability</span>
<span class="nonByoText">Low</span>


In the BYO section I have copied
 
<style>
.question.acbc_byo .nonByoText {
    display: none
}
</style>


In the non-BYO sections I copied
<style>
.question:not(.acbc_byo) .byoText {
    display: none
}
</style>


When I test the ACBC, the description for the attribute level in the BYO question is :
Low breathability Low

while it should be :
Low breathability.

In the following non-BYO sections it is as it should be:
Low

I tried to find the mistake but couldn't find the solution yet. Do you have any idea what I am doing wrong?

Thanks in advance
Michael
This code will not work in level labels if the BYO is set to use dropdowns instead of radio buttons.  Is that what is happening here?
Dear Zachary,

thanks, it works with radio buttons!
 Is there a way to make it work with dropdown?
We'd need to take another approach to support dropdowns.  You can start by removing the HTML from the level texts - just the non-BYO text will be fine there.  Then in the BYO question, we can add this script:

<script>
$(document).ready(function(){
    $('#[% QuestionName() %]_1_1_label').text('first text');
    $('#[% QuestionName() %]_1_2_label').text('second text');
    $('#[% QuestionName() %]_1_3_label').text('third text');
})
</script>


That will change the texts of levels 1, 2, and 3 for attribute 1.  You can repeat and update these lines as needed for all the levels you want changed.
Dear Zachary,

that works for the dropdown version, thank you!
...