I think you could have guessed I was planning to split the Display template into several functions just like I did for the index template... But the good news is that you did it in a very clean way and I couldn't have done it better so it's all good
:) (Maybe I would have removed the spellchecker though... I'm not exactly sure how useful it is in these days when most browsers have inline spellchecking.)
(Plus, I'm having such a hard time working on Wedge these days...)
I'm not so bothered by the physical status part, though that is ultimately the way to do it. What concerns me is how we show the user. How do we display it?
It's the easy part to me...
:^^;:I'd also prefer to separate deleted-by-author from deleted-by-moderator.
Sure. The 'approved' field can really have any value at this point... As long as the only valid value for showing a post is '1'...
I've started work on it, BTW. Although I'm currently trying to determine whether I should keep it as 'approved' or use the opportunity to rename it to 'status'.
As far as empty-skeleton errors, that implies a logic error, and if there isn't a fatal error shown to the user, what would happen? I'd argue that a page with no content is less helpful than a page with an error message.
Possibly. But maybe we should also log the contents of the empty skeleton for admins to look into...
Posted: October 7th, 2011, 04:28 PM
@ Nao: Something in my brain told me not to make the title_upper and _lower parts (which are used for the page titles/go up+down areas) into a template layer but I'm not sure *why* my brain told me that. If you wanna change it, please go right ahead.
I have absolutely no idea why this shouldn't be done... I'll be working on it. It's not like it can't be reverted...
Posted: October 7th, 2011, 04:32 PM
Oh, and one thing that could be improved... Testing for some values and, if they're not true, either don't add the corresponding block, and simply removeBlock() it... (Well, the problem with the second solution is that when we start using an object for this, it'll be a tad slower than just unsetting the block in the skeleton array...)
What do you think of this?
Another possible improvement: allow for params to be passed to template functions. Something like, loadBlock('mod_buttons', 'upper'), with 'upper' being passed to the template function so that it knows what to show.
Posted: October 7th, 2011, 04:37 PM
Having trouble with the postlist (i.e. topic posts) layer...
So, if I want to load the layer into default, surrounded by blocks, I have to do it this way...
loadBlock(
array(
'report_success',
'display_draft',
'title_upper',
'topic_poll',
'linked_calendar',
)
);
loadLayer('postlist', 'default', 'child');
loadBlock('display_posts', 'postlist');
loadBlock(
array(
'quick_access',
'mod_buttons',
'quick_reply'
),
'',
'add'
);I'd say it's pretty ugly.
Other solutions:
- add the ability to specify layers directly within the block list, by specifying a sub-array, and possibly other blocks inside the array.
- just forget about it...
- add the layer after the main block code, and add to loadLayer() the ability to inject a layer before or after a *block*, just like loadBlock offers the ability to inject a block before or after a block or a layer. This is my favorite solution (I like the second one equally, though...
:^^;:), but it may make the code even more confusing... (?)
Opinions?