Hi,
In your form for yesno
you can assign values for yes and no ( "=true value" "!false value" )
. For the false value it is possible to put into the variable any wiki markup you want to have shown in case of NO.
In your template you use your variable ---- dataentry ---- Prefer_wiki: @@yesno@@
.
You can define a data entry type _wiki
, which holds your wiki markup in case of NO. If you post that on your page it should show the rendered markup only in case of NO, and otherwise nothing. Correct me, if I am wrong!
Also, you can add some wiki markup like a special heading to the dataentry of your textarea. You even could have all your entries listed on your page, each beginning with a special heading. This makes them accessible and distinguishable by Javascript, as I explained here (using JS/jQuery) ...
Chris75 If you want to create a new page with embedded HTML
... how to insert any wiki page content (as a list of HTML), only IF a condition (in form of a selector) is true. At first, the selector checks, if a certain flag element is already on the page. As I discuss in my example, this flag or dummy element (the special heading placed at the beginning of each dataentry) could even be removed afterwards, so the user will never get to see it. (These headings should be unique, so they don't interfere with the rest of your wiki.) This might be a solution to your problem.
In summary, the logic behind this proposed solution is the following:
- you write all the data you gather about the subject on the individual page (by using the form and the template)
- plus you write some flag headings on the page about the users individual choice (by _wiki type of variable)
- and in the end, you use Javascript to selectively hide any data that is needless (by addressing the flag headings in the jQuery selector)
This logic should work for multiple individual pages instead of just one special case.
In practical terms:
- form collects information: yesno and textarea
- writes dataentries with flag headings (in wikimarkup) - for yesno, depending on the choice of your user
- template writes wikimarkup on the page
- Javascript detects flag headings, hides them and their content before anything is rendered, depending on the choice of your user, IOW depending on what it finds on the page
Cheers!