Example: My kingdom for a rich text element
Storing the data here (or in the system through other methods) will provide a long term value and benefit to most businesses (depending size etc) occasionally though that won’t matter and the preferred format of the client must be achieved.
As a small example I needed to achieve the following output for a particular template:
“You are a balanced investor who wants a mixed portfolio to work towards medium to long term financial goals…”
So the stopping point was this bold text. How to achieve that with this distinctly poor text element?
Potentially a quick fix would have been to just statically add in “You are a” and code the bold risk profile, this way the description text could start at the equivalent of ‘who wants…’. But not all risk profiles started with “You are a…” plus their risk profile questionnaire wasn’t going to have that bold but we wanted to draw from the one source still to reap those advantages.
The solution used in the end was similar to the below.
<:let riskprofile=$client.risk_profile.attitude_to_risk().risk_profile_desc.split($client.risk_profile.lower(),1):>
<:=riskprofile[0]:> <:=$client.risk_profile:> <:=’ ‘.join(riskprofile[1:]):>
# You are a Balanced investor who wants a mixed portfolio to work towards medium to long term financial goals. You require an investment strategy that will manage the effects of taxation and inflation. The risk tolerance of a balanced investor is suitable to strategic, calculated risks designed to achieve good returns.
You can even code in the client/partner/joint/entity names quite easily if it is required that they are within the description, for a personalised effect. The point of this example was to show that with a bit of thought and problem solving you can still use this area if the client has stylistic requirements like the above.
Wait a minute…
You might have noticed that the above example corrodes one of the benefits I mentioned. Namely, if they completely re-write the risk profile descriptions and style of the section in the future, the document wouldn’t merge as they might expect. This is true, although I did build in a mechanism to allow it to revert back to the standard desc call without needing to edit the coded doc.
Ultimately if things change entirely, you often can’t avoid messing with the coded document but in the interim to them doing major changes they will be able to manage, add to and edit those risk profile descriptions with a lot more ease than the traditional alternative (statically coded and repeated in the template and across multiple templates).
Again for sites with multiple licensee or risk profile sets the advantages are just further magnified.