[wp-hackers] One CMS to Rule Them All (was This was painful to read...)

Otto otto at ottodestruct.com
Thu Dec 3 14:54:14 UTC 2009


On Wed, Dec 2, 2009 at 4:41 PM, Mike Schinkel
<mikeschinkel at newclarity.net> wrote:
>> I don't like your particular visions about URL routing, because I
>> think you're thinking too narrowly and focusing on your specific needs
>> instead of having a wider scope, but I'm not generically opposed to
>> making URLs easier to work with.
>
> My reaction is to think you don't understand my visions because I'm looking to make it more generic not less, and my perception of your criticisms is that you are trying to constrain it to be less so.  Of course that's all my perception which is probably not the reality.

Absolutely not the reality, because I'd say the exact same thing, only
flip-flopped. You're making your focus too narrow. Your whole idea of
tying a rewrite URL down to a custom template is far LESS generic than
the existing system.

In other words, the examples you have given are a *subset* of existing
functionality. It's already more generic and more capable than what
you want it to be able to do. You're trying to constrain the system to
your specific needs. I'm trying to not do that.

> So let's get pass this and try to figure out what works.  Can you explain what you think my vision is (so I can either agree or correct it) and then why you think that vision is too narrow by giving counter examples?

The example you've posted several times is something like this:
add_custom_url( array(
  'name'          => 'product-page',
  'url_type'      => 'single-post',
  'url_template'  => 'products/{product_slug}',
  'template_file' => 'custom/product.php',
  'post_type'     => 'product',
));

That's very, very specific. You're basically defining a custom-url and
attaching it to a fixed template and template file with a specially
defined variable name, hooked to posts, etc, etc. Even if you assume
that there's multiple types here, it's much *less* flexible than what
is already in the core. It may be simpler and easier to call something
along the lines of your version, but it's limited in its capabilities
to the types of URL direction that you have pre-programmed into it.

That's what I mean by specific vs. generic. Generic is
add_rewrite_url, which lets you use a simple regexp to define any sort
of rewrite you want. Generic is template_redirect, which lets you
redirect to any template you want based on any criteria you can dream
up.

Your "vision" seems to be focused on pre-defined ways of doing things,
in ways that you have given custom names to (like "single-post").

-Otto


More information about the wp-hackers mailing list