I'm trying to find the best way to build two versions of webhelp so that one is locked for more privileged users, the other for less. The idea is to use a publishing task that generates the two versions in sync, and locates the privileged one on a server that requires authentication. The locking might be for draft vs final, user vs superuser, free vs subscription etc.
The challenge is that both versions should contain
all the topics, but in the less privileged version
some topics have their <%TOPIC_TEXT%> replaced with a placeholder asking the user to log in, which transfers them to the privileged version. The benefits are:
- no need to maintain conditional logic within topics to prevent broken links,
- readers can see TOC entries for locked content, so they have an incentive to log in or register etc.
What's the best way to achieve this? I know it can be done using IF/ELSE conditions within topics, as below:
conditions-within-topic.png
In that screenshot, the topic text is displayed in both builds and the login placeholder doesn't appear in either build. To force login for a particular topic, I just remove the "PUBLIC BUILD" term in the condition, so the content is included when I build the privileged version, but the placeholder when I build the public one. The placeholder can be a snippet so there's only one place to maintain it.
This technique works but it feels hack-y:
- The conditional tags mess up the clean look of the editor and are easy to over-write by mistake.
- There's no flexibility to have multiple TOCs with different locking conditions.
- I'd like the locking decision to be visible in the TOC, as below.
custom-build-ID-in-editor-toc.png
I'd rather do this using build conditions in the HTML template to replace the <%TOPIC_TEXT%> with a placeholder. I've read
conditional output in HTML templates but I can't see how that can do the job. Any suggestions?
You do not have the required permissions to view the files attached to this post.