h5bp / lazyweb-requests

Get projects and ideas built by the community
https://github.com/h5bp/lazyweb-requests/issues
1.69k stars 85 forks source link

Boilerplate WP Custom Posts Framework #70

Closed grayghostvisuals closed 12 years ago

grayghostvisuals commented 12 years ago

I am looking for support and help from the community with a blank boilerplate Wordpress framework. Currently my framework allows for custom posts, custom posts taxonomies, foundational theme options plus some more bells and whistles.

It's a framework for theme authors that submit to the WP repository as well as general building. The nice feature with this framework is the custom posts feature which allows authors the ability to add custom posts and correlating meta data, feature images etc. It still has some bugs to kick and polishing to be done but I know there is someone out there that would like to participate in this. Maybe it can be something to give to the H5BP community at some point if there is support?

I started building this for the reason that I was constantly being asked to build sites that have both a journal/blog and a portfolio/case studies feed and I hate plugins. With custom posts/case-studies this is totally possible.

https://github.com/grayghostvisuals/WP-Flex

drublic commented 12 years ago

A while ago I've started to do something similar, but have not had the time yet to "finish" it. I think people need it but I am not sure if this fits into the H5BP-community as it is a WordPress project…

Haven't looked into your code, but will do so sometime soon (hopefully).

grayghostvisuals commented 12 years ago

@drublic Cool man thanks. I know it is a Wordpress thing, but I was hoping we could turn it into an H5BP thing like what is being done for the H5BP html boilerplate. Either way it sucks Wordpress doesn't have this by default :(

userabuser commented 12 years ago

If I understand you correctly, then I'm in support of this idea - although I'm not sure if there would be an uptake in the H5BP community as its specific to WordPress. However it is in the name of moving the web forward since WordPress is a big part of it! I develop almost all of my client sites on the WordPress platform, except for those projects where a custom platform may be more suited and I have had the same idea for a custom post type framework too, naturally one that does not rely on the use of plugins because I am very much against that from a developmental point of view.

The thing is though, what do you already have in mind for an example of how this framework might function?

I've been toying with a few ideas most of which are abstractions of the already existing CPT API which allow you to declare a CPT quickly in a short-hand format and also another idea which enabled you to declare CPTs from within the dashboard (I know that's very similar to a plugin) however its built into the base-theme itself and uses a combination of an syntax-highlighter editor (with auto completion especially for this purpose) as well as interface type elements and controls that allowed for rapid deployment of CPTs and additionally custom meta boxes so you could fully flesh out a CPT based on the client-purpose/need within minutes. Not sure if that's along the lines or centric to your request here.

Either way, if you started this project outside of H5BP there's enough WP-community that would probably back, support and contribute. I being one of those.

grayghostvisuals commented 12 years ago

@userabuser

It appears I'm a bit confused with what deems to be an appropriate H5BP community request or in this case a "lazy web request." I look at the H5BP community as a place where we can move the web forward with tools that help make our jobs smoother and easier to manage.

Even though it is Wordpress, it is just another boilerplate for Wordpress developers approved by the H5BP community as another great foundational starting point for any wordpress project.

Kid Tested H5BP approved!

userabuser commented 12 years ago

@grayghostvisuals

Hi,

Hence why I did say I am not sure if...

In my opinion it is centric to moving the web forward.

So that aside I'm interested in hearing more from you on the topic, in relation to all else posted in my reply above.

grayghostvisuals commented 12 years ago

@userabuser

You can take a look at my repo link posted where it discusses the features and test drive it for yourself. I have also started a WIKI where it will help to answer any further questions

https://github.com/grayghostvisuals/WP-Flex

userabuser commented 12 years ago

@grayghostvisuals I already did that prior to commenting, however I don't see anything more than a custom framework with one pre-defined custom post type of "case studies" which albeit is general - may or may not apply to developers/users. So I am struggling to see how this relates to creating a Custom Posts Framework which to me suggests some kind of way to programatically roll out custom post types on a case by case scenario that has benefits over and above the way in which we currently declare them. So unless I am missing something glaringly obvious(?) I'm stumped.

There's not much advantage in collaborating on a project where by we are defining nothing more than registering a CPT in the functions file for a generic post type. As you mentioned above in your OP this template benefits your use case where you need CPTs for portfolios or case-studies.

...but I need them for all kinds of purposes.

What are you proposing as your ideas that would help solve this for someone like me for example...?

grayghostvisuals commented 12 years ago

@userabuser

The framework gives theme developers more than just a custom posts foundation to branch from, It also provides many of the fundamental basics required for all theme developers per the codex. Things like a theme readme.txt file (a strong suggestion of the codex), specifically formatted css and css comment flags to make life easier for theme reviewers, base files for template page hierarchy, theme unit test for all theme makers, a cache manifest starting foundation for all wp themes, all required functions present in the functions.php file for theme submissions, a boilerplate themeoptions.php...etc.

So not only does it give the ability to have custom posts already there(others can further customize), it also is a general "best practice, don't forget to do these things" for theme makers.

I'm all ears to do what we can do to make it better or more streamlined towards the needs of what developers/theme makers are in need of.

userabuser commented 12 years ago

@grayghostvisuals

I gathered from looking at your repository that your theme lent itself to just that - a basis for theme standards.

The issue is that I've taken your title "Boilerplate WP Custom Posts Framework" as being literal, as one would assume that is generally the keyword phrase that describes the context of the topic - in other words, Custom Posts.

Your OP description talks mostly about it being a framework for Custom Posts/Taxonomies/MetaBoxes etc and only lightly touches on it being a framework for developers submitting to the theme repository as well as development in general.

So when I looked at your theme thinking I'd see something centric to a Custom Posts framework - I only saw your default 'cases' Post Type.

Therefore you might want to update the title of your Lazy Request so it better reflects your goal and quite possibly restate your goal so it ties in with the theme of your repository.

My thoughts so far on your theme are this;

1) It's not a custom posts framework 2) Your default custom post caters to you more than developers at large 3) I like your intention with the theme overall to provide a good foundation for standards based development

If you want to make your framework more useful, I would suggest removing the specific nature of your custom post type and think about a way to allow developers to deploy a custom post type of their choice which is standards compliant (i.e. code compliant/registered properly etc). That's what a framework/boilerplate should do in my opinion, it should be non-niche-specific, general enough to apply to anyone who picks it up, but yet meets its objectives and its goals - the purpose for which you set out to create the framework in the first place.

As an example - I've written a very crude, not that functional PHP script which will parse a particular function/string in which I feed it and out the other end it will compile a custom post type into the functions.php which when you or anyone else opens the functions.php file they see perfectly readable WordPress code pertaining to a registered post type.

The purpose of this was simply to pass some short hand string, which output a much larger block of code - instead of continuously having to write that some larger block of code line by line, or even copy and paste that block from your snippets file. It was simply a test in improving the speed in which I can develop a theme by reducing the overhead on commonly written functions.

Simple idea... so how about taking the similar approach but instead of an external script parsing a string, why not have a default custom post type (template code-block/function) which you pass arguments to for such things as post type name, rewrite slug, labels etc.

An example might be;

<?php create_post_type('post_type', 'slug', 'has_archive', 'etc');?>

...and that would essentially define a custom post type of your choice by passing those arguments to a function create_post_type which holds all of the necessary register_post_type code.

Crude example I know.. But this is along the lines of what I am thinking about in terms of improving developmental processes.

Anyway - your theme as it stands, despite the initial confusion on the topic, is a good effort - so keep up that good work man!

grayghostvisuals commented 12 years ago

@userabuser

Wow! awesome and exremely useful feedback. I would love to make the custom posts capability more plugin like that is consistently maintained, standards compliant and directed towards the larger needs of the development community. However I am crude at best making plugins for wordpress and I think having a base for theme developers is more appropriate than custom posts.

Ill make sure to go back in my repo and rework it to be more direct with my goals and intentions. Maybe another branch would be for the custom posts plugin....who knows. Thanks for the feedback and great points as it really helps to have direct commenting and discussion from the community to illuminate my scatter brain ideas :)