live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Post Fields
« on January 13th, 2013, 07:18 AM »
This is the first plugiin that I've ever started for Wedge. You may be able to recognise that it takes the principle of the custom profile field and applies it to posts.

I've long thought that SMF/Wedge were very one-sided in allowing for profiles to be expanded upon but not posts. This is my answer.

I built this to be plugged into, with ~6 hooks. This enables me, and other plugin developers, to easily modify the interface and logistics of posts and even topics. This,, combined with floating boards, provides a horizon of limitless opportunities and new ideas. Well, not unlimited, only goes as far as the imagination wills.


A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
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

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Post Fields
« Reply #2, on January 13th, 2013, 08:23 AM »
This is pretty nice! I had a question, can someone add a field type to custom profile fields (and by extension, to this plugin)?
The way it's meant to be

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
Re: Post Fields
« Reply #3, on January 13th, 2013, 08:30 AM »
No. A generic form class would solve that, though. But, ofc, there's the possibility of utilising a hook for this...

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
Re: Post Fields
« Reply #4, on January 13th, 2013, 09:48 AM »
Quote from live627 on January 13th, 2013, 08:30 AM
No. A generic form class would solve that, though. But, ofc, there's the possibility of utilising a hook for this...
Hooks can be uglier than forms, but probably simpler to implement.

Re: Post Fields
« Reply #5, on January 13th, 2013, 01:42 PM »
Does the template recognise the new fields by hooks, or does the theme have to check for it? Will it just stack items below each other, or does it have some sort of layout engine too (tables, grids)?

Reminds me a bit about Drupal..and its an absolute nightmare to change CCK fields to a decent layout(having using another module just for that, rewriting the built-in html code from scratch and so on..ugh)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post Fields
« Reply #6, on January 13th, 2013, 06:57 PM »
It's not set up like that, the template has nothing whatsoever to do with.

Each page is made up of a number of small units, the new area is a new sub-template added in between the other sub-templates. It's all controlled by the plugin saying 'hey, I want to add this sub-template to the list of templates, before that one/after that one'.

The problem with doing it any other way is that it gets very unwieldy very quickly. Either you make the theme capable of handling almost anything you can imagine, which makes the theme slow and massive, or you allow plugins to take responsibility for their own display which is what we're doing.

Re: Post Fields
« Reply #7, on January 13th, 2013, 07:26 PM »
Ok, but will a theme be able then to customise it..or will it be stuck with using the default subtemplate? I would assume it has to use default CSS styles too, to keep the same color choices etc.

This is not a criticism as such, just curious on how it works/will work.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post Fields
« Reply #8, on January 13th, 2013, 07:32 PM »
Well, we did explain how it was going to work ages ago when we accepted the fact that themes cannot have total control over everything if you ever have any illusions of having plugins ;)

OK, here's the run down: everything's built out of subtemplates. We have not yet established whether we're going to allow separate physical themes that can replace the subtemplates with their own, though there are certain things that are controllable by the themes - for example, the markup that makes cat_bar and title_bar areas is not true markup; templates output <we:cat> and <we:title> for those, and the skin itself can set what HTML should be used there.

A plugin provides its own subtemplates for things it wants to use where not covered by any of the existing subtemplates in the system. It should of course use the same classes and markup as the default subtemplates, and a skin has all the ability of CSS to restyle that, just as it would be able to reskin the default theme itself.

Re: Post Fields
« Reply #9, on January 14th, 2013, 12:31 PM »
I know you outlined this before, but haven't followed recent development in this area, hence the question - I am still not convinced this will appeal to designers..but of course it makes sure everything just works. In the long run, thats what counts.Design is overrated anyway, according to some sources. :D

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Post Fields
« Reply #10, on January 14th, 2013, 06:31 PM »
Where did we say it was about appealing to designers? :P

The whole point of the sub template structure is to ensure that plugins just work cleanly. Designers do have facilities that SMF didn't provide, too.