Had trouble deciding where to post this

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Had trouble deciding where to post this
« on October 29th, 2011, 12:46 AM »Last edited on October 29th, 2011, 12:57 AM by Arantor
For once I had trouble deciding where to post this. It's sort of plugin related, sort of feature related and sort of rant related. Eh, let's go for off-topic then, heh.

OK, so my current project for this evening is to break up that damn post template. Seriously, even with the changes I made before, which split the poll creation and event creation and some other oddments out into their own functions, there's still a massive unit that is the post form.

And, sadly, the more I hack away at it the worst I feel like I'm getting with it :/ In the new template skeleton structure, you have layers and blocks. A block is, semantically, an atomic piece of content that doesn't need to contain anything inside it, e.g. one item in the info center, while a layer is a container of blocks, as in it has one or more blocks in it and maybe some code before or after the list of blocks in it. The info center itself is a layer, the bit before the contents is the opening of the IC, then the content blocks, then the end of the IC.

And, that's stored inside the sidebar layout so you can add things either before or after the info center as a single item or you can add things inside the IC. It's pretty cool actually.

But the post form is enormously complex, far more than anything I've yet made with the system.

In case you're wondering why it's so complex, just imagine what the post form might contain.

Start the post form
    Preview area
    Display any errors
    If it will require moderator approval, advise user
    If locked, advise user that only moderators can reply
    Begin the post header
        If guest, ask for name and address
        Post subject, icon
    End the post header
    Optionally, the calendar event builder
    Optionally, polls
    The postbox
    Additional options
    Attachments
    Verification/CAPTCHA
    The submit buttons
End the post form

(And that's all inside just the main area) Small wonder it's been giving me a headache, and that's before I begin to worry about how the wireless template is going to support any changes, though to a degree I almost don't care about WAP2 support for extensibility; it's not like most post-form mods extend WAP2 anyway, but that's not the right attitude to have.

Yeah, it's complicated, but the upshot is that adding items into the form is absolutely trivial now, and you have a pretty good degree of control about where things go. (Note that some of these already have other related facilities, e.g. the post/preview/save draft buttons are manipulatable through another interface, so you don't need to mess about to add buttons, as well as extending CAPTCHA types is done through other hooks)

That wasn't much of a rant. I guess I'm a bit tired of ranting :P The problem is that it's a very large block of a template, and that sort of thing has to change. The downside is that it ends up being lots of little bits rather than one big bit which can make it harder to deal with.


:edit: I missed some stuff. Duly added.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,082
Re: Had trouble deciding where to post this
« Reply #1, on October 29th, 2011, 01:16 AM »
I'm not sure there's a question in this ;)

Btw I changed a couple of lines in the post template to deal with my windowbg rewrite I told you privately. Not that it matters if it conflicts...

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Had trouble deciding where to post this
« Reply #2, on October 29th, 2011, 01:26 AM »
There isn't a question. It's more of a monologue on the fun I've having.

It almost certainly will conflict, but I suspect it won't be a huge problem to fix.