1

I have created a attribute called »size«, it is of type Dropdown and my client would like to insert Fractions (1/3, 2/3 and so on) as values.

I have tried to insert the values using basic html syntax like this:

<sup>1</sup>&frasl;<sub>10</sub>

With the result that the size displayed correctly in the backend, but does not appear in the frontend.

So I am searching for a way to make the client enter the fractions in an easy manner and would prefer a solution where he has to write something shorter, like:

${1/3}

what I could process before it is send to the browser.

Any Ideas how this could be done, or where I could preprocess the attribute?

Thanks in ahead!

3
  • Did you manage to get the issue resolved? Dec 18, 2014 at 12:38
  • Yes I could, but it was much more complicated than just changing a template. That is because the dropdown lists are generated by some javascript, so the only place to make fractions appear is by adding some js. Additionally, insinde <option> no markup is allowed, so the fractions needs to included in the Font.
    – philipp
    Dec 31, 2014 at 13:45
  • Please add your solution as an answer and accept to close the question Dec 31, 2014 at 18:59

1 Answer 1

1

Might it not be easier to accept 1/3 in the backend and do the styling in the frontend where you output the attribute? In that case the change should be quite easy

2
  • well, that is more or less what I am trying… The question is, where is the place to do the processing… Actually, the Dropdown list for all the attributes is created via Javascript. Since the Text of the attribute appears in <option> elements, it is not possible to style that, without overriding the whole template of the list…
    – philipp
    Nov 17, 2014 at 13:56
  • I would rather rewrite the list template than make it possible to add this via backend. Will take a lot more work Nov 17, 2014 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.