Closed TomWildenhain closed 5 years ago
Could this perhaps be covered by (optional) per-puzzle custom CSS, or are you envisioning something more involved?
I think the answer here as you mentioned is just a textField on each puzzle (and I'm probably doing the same to each hunt while I'm at it). This is just something that can hold some amount (I'm thinking 200?) of unicode characters. This data will be assignable via the admin interface and just accessible in the template off the puzzle object ("puzzle.extraData
"). That way it can be used for CSS, HTML, or whatever you want.
@timparenti For this next hunt I would like to add subtitles to some of the puzzles (which would be an HTML not CSS change). @dlareau The data text field will definitely work for what I'm currently planning. I suppose the most generalizable method would be to make it be a dictionary of key/value pairs (strings to strings) that would be accessible in the template using puzzle.extraData.keyname
. You could just make a 200 char field that gets parsed as JSON and accessible as extraData.
Added in cc06657, to be released in 3.4. Currently just a text string for ease of use and flexibility.
Settable in the admin interface for any hunt or puzzle, accessible in the template by {{ puzzle.extra_data }}
JSON parsing can be done at the client page level if desired (Or in the database if we end up switching to postgres which supports dict fields on models). I have no desire to add json parsing a step required in the server-side rendering of the main hunt page.
It would be nice if there was an additional field for puzzle objects that we could access in the hunt template. For example, I want to make each puzzle in this hunt have a subtitle that is displayed on the main hunt page. I can imagine other use cases where we want some puzzles to show up with different colors/icons, etc. If we just had an "extra data" string field on each puzzle that we could access in the template, that would be most flexible, unless you think there is a better way.