title: Home
fields:
category:
label: Splash
type: radio
default: B
options:
B: B
A: A
I’m trying to do what’s being discussed in this thread, trying to “include a different snippet depending on page settings” as @texnixe suggests, but think I am implementing it wrong…
… which seems kind of more future proof to me, if an option ‘C’ will be added one time or radio will become a select. ‘B’ is set as default, so nothing unexpected should happen.
I agree that this could be an issue, if the text file is edited outside of the panel. You could, however, build in a security check to make sure that only a snippet which is in the allowed options can be selected.
Would the original answer not be subject to this security problem?
If I implemented the future proof but riskier answer, how would you build a security check?
and parse the same file when selecting the snippet to check if the value is correct.
you could also add a md5/sha1 value of the original json file to the code to make sure it has not been altered. http://php.net/manual/en/function.sha1-file.php