3.8 Theme Development - Speak now all forever hold your tongue

11 views
Skip to first unread message

Jeffry Ghazally

unread,
Aug 31, 2010, 10:07:27 PM8/31/10
to wordpress-e-c...@googlegroups.com
Ok this is the draft for getting everyones approval through the mailing list.. If we are STILL on the wrong track ill jump off a bridge..

Hi Guys, 
So theres been a lot of debate / feedback on how 3.8 Theme system is currently structured, I've been pretty busy testing and debugging bits and pieces. However have been keeping an eye on the conversations,,, Lightspeed and Lee had some good points, which provoked a few long discussions with Justin. Since then Justin and Lee have had their own wee private conversation and some of these thoughts have materialized into a Google Doc (printed at the bottom of this message)

Anyway here was my take on it, and this is what I think everyone agrees on (if not nows your chance to speak up, theme engine side of things is going through its 3-rd iteration and we can't afford to keep looping)
1. Stuff out of wpsc/ folder and into <themeFolder>
 - The main reasoning being we are re-implementing stuff that WP already handles, 

2. NOT move all template stuff over with a click of a button? 
- This is where I semi-disagree, they should be given the option, I believe, because every site owner wants their shop to look different to the next shop.. and if they just dive into wp-e-commerce/themes (which will always be the fall back BTW) then they will get pissed off after they upgrade and loose their changes.. (instead of asking them to install a plugin i.e bp-templatepack just give them an option to make their current theme wpsc aware.. which kinda already works apart from single product..)

3. change of naming conventions to be more semantically correct
- Absolutely positively LOVE this idea,, biggest thing is figuring out what that is,, there has been some confusion for the last wee while on whether it should be wpec or wpsc,, I personally believe leaving it at wpsc for now, (since having both will undoubtly cause more confusion than good) and when the next major release 3.9 starts traction we will go over all wpsc and replace with wpec.. better to be consistently inconsistent no?

4. Leave uploads themes alone,,, 
- So this is our biggest hard to tackle backwards compatibility issue, which Justin has come up with a solution for porting them over to the themes folder,, using same click of a button as #2, 


Alright, so we're gna be watching this thread,,, we need to make a decision in the next 24 hours so development doesn't fall behind... it is important to get things right, but we could argue and dicuss till the cows come home (which is what we've been doing) and still get no where. I respect everyones opinions and do want to make sure we are going for best practices, but it all comes down to resource, and time..... 

Best Summary So far: 
'Yeah, I think as long as we can make sure to ensure the backwards compatibility works well with old themes, everthing works elegantly with new themes - I'm happy.' -Justin


best
jeff



Hi Justin,

 

So – my “vision” for how I imagine it working (The caveat is that I don't know that this stuff is possible – but most of it certainly seems to be from what I know, and have read.

 

For each of the files currently in wp-content/themes/<mywptheme>/wpsc/ I've added a brief note below about what & where I think it should be, and a summary of what a “new-style” file structure would be.

 

wpsc-cart_widget.php
This would be called wpec-widget-cart.php, and would be stored in the main WP theme folder (wp-content/themes/<mywptheme>/.

 

This would be processed by the WPEC code by calling get_template_part ('wpsc-widget','cart'); allowing the file to be overridden by a child theme.

 

Note: get_template_part currently doesn't provide a filter to allow “fallbacks” to be used (E.g. to force it to use wp-content/plugins/wp-e-commerce/themes/wpec-widget-cart.php if no file can be found in the theme. I suspect you can test the return value, but would need testing.

 

wpsc-category_widget.php
This would be called wpec-widget-category.php, and would be stored in the main WP theme folder (wp-content/themes/<mywptheme>/).

 

This would be processed by the WPEC code by calling get_template_part ('wpsc-widget','category'); allowing the file to be overridden by a child theme. See also note above.

 

wpsc-checkout.php
No longer required? Isn't this done via wpsc-shopping_cart_page.php ?

 

wpsc-default.css
I guess this should exist, and be queued from wp-content/plugins/wp-e-commerce/themes/. As long as this is queued with wp_enqueue_style() then theme authors can disable it if required.

 

wpsc-functions.php
Not required.

 

wpsc-products_page.php
This would be taxonomy-wpec-product-category.php (Or wpsc if you like :) ) and would be stored in the main WP theme folder (wp-content/themes/<mywptheme>/) .

 

We would hook onto get_taxonomy_template() to fallback to wp-content/plugins/wp-e-commerce/themes/taxonomy-wpec-product-category.php if the theme/child-theme doesn't provide a file to use.

 

wpsc-grid_view.php
Not required. The standard view will be provided by the new wpsc-products_page.php (See abovfe). A plugin providing an alternative view would hook onto get_taxonomy_template to re-direct from the standard file to the plugin's alternative file. The plugin author is free to use get_template_part to get their file (Thus allowing end-user customisations through child themes etc.) - although obviously that's out of our control for non-Instinct authored stuff.

 

wpsc-list_view.php
Not required. See notes on grid_view above.

 

wpsc-products.php
Erm, actually I have no idea what this is for :)

 

wpsc-shopping_cart_page.php
This would be called single-wpec-checkout.php (In preparation for the checkout being implemented as a custom post type – if the longer term view for this is something then we should name it appropriately.) and would be stored in the main WP theme folder (wp-content/themes/<mywptheme>/).

 

Since it isn't a custom post type yet – in the short term you can hook onto get_page_template to force this to be picked up, by calling get_template_part('single','wpec-checkout'), and checking the return value as per notes above.

 

wpsc-single_product.php
This would be single-wpec-product.php, and would be stored in the main WP theme folder (wp-content/themes/<mywptheme>/).

 

We would hook onto wp_single_template() to provide a fallback to wp-content/plugins/wp-e-commerce/themes/single-wpec-product.php if the theme doesn't provide a file.

 

 

Example file structure.
In this example the files that actually get used are highlighted green.

 

wp-content
              plugins
                            wp-e-commerce
                                          themes
                                                        single-wpec-checkout.php
                                                        single-wpec-product.php
                                                        taxonomy-wpec-product-category.php
                                                        wpec-default.css
                                                        wpec-widget-cart.php
                                                        wpsc-widget-category.php
wp-content
              themes
                            FunkyWordPressTheme
                                          single-wpec-product.php
                                          taxonomy-wpec-product-category.php
                            MyFunkyWordPressTheme
                                          single-wpec-product.php

 

Ben Huson

unread,
Sep 1, 2010, 4:33:48 AM9/1/10
to wordpress-e-c...@googlegroups.com
I agree with all that I think.

Regarding point 2 I see no harm in including a button to move over
template files. Surely this is similar to having the bp-templatepack
type functionality built in?

Is there any reason why this would be a bad thing?

- Ben

On 1 September 2010 03:07, Jeffry Ghazally

> --
> You received this message because you are subscribed to the Google Groups
> "WordPress e-Commerce Plugin Development" group.
> To post to this group, send email to
> wordpress-e-c...@googlegroups.com.
> To unsubscribe from this group, send email to
> wordpress-e-commerc...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/wordpress-e-commerce-plugin?hl=en.
>

Lee Willis

unread,
Sep 1, 2010, 4:45:08 AM9/1/10
to wordpress-e-c...@googlegroups.com
> Regarding point 2 I see no harm in including a button to move over
> template files. Surely this is similar to having the bp-templatepack
> type functionality built in?
>
> Is there any reason why this would be a bad thing?

Under the new "design", people should be creating a child-theme with the
customisations they require. If we move stuff into the main theme, then
their customisations will be lost if they ever update their WordPress
theme. Since themes are now part of the "auto" update mechanism in
WordPress this is probably a bad thing.

All IMHO ...

Wouter Thielen

unread,
Sep 1, 2010, 4:56:37 AM9/1/10
to wordpress-e-c...@googlegroups.com
If users want to customize, then they should actually create a new
theme, which should be skipped during auto-update because WP does not
know about updates of this theme. Or am I seeing things wrong here?

Also, if customizations only consist of small CSS changes, then what
about a user.css in the theme directory, which should never be
overwritten by the auto-update.

-
Wouter Thielen

Software Developer
Software Research & Development Div.
LINC Media, Tokyo

Lee Willis

unread,
Sep 1, 2010, 5:09:23 AM9/1/10
to wordpress-e-c...@googlegroups.com

> If users want to customize, then they should actually create a new
> theme, which should be skipped during auto-update because WP does not
> know about updates of this theme. Or am I seeing things wrong here?

Nope - that's what I said - except I was explicit that they would create a
child theme ... I guess there's no reason it couldn't be a standalone
theme - as long as it isn't auto-updateable ...

Lee

John Jacoby

unread,
Sep 1, 2010, 5:09:40 AM9/1/10
to wordpress-e-c...@googlegroups.com
Precisely...

Ben Huson

unread,
Sep 1, 2010, 6:50:05 AM9/1/10
to wordpress-e-c...@googlegroups.com
So, will users have to manually copy wpec files into a child theme?

Or should users be told to create a child theme and activate it then
click a button to copy the wpsc files to the child theme?

I don't want to get hung up on the button thing - I'm quite happy not
to have it as I'm capable of doing all this myself - but I'm wondering
if it will be more friendly for users? Is it possible to detect if the
current active theme is a child theme and if so show a copy files
button if a child theme is active, otherwise show instructions to
create a child theme?

- Ben

Lee Willis

unread,
Sep 1, 2010, 8:38:17 AM9/1/10
to wordpress-e-c...@googlegroups.com

> So, will users have to manually copy wpec files into a child theme?
>
> Or should users be told to create a child theme and activate it then
> click a button to copy the wpsc files to the child theme?

Personally, I think they should manually copy the files that they want to
override into their child theme. There's no point copying all of the files
(Under the new scheme it's unnecessary), and in fact doing so, may mean
that they miss out on updates to files that they haven't customised.

Regards
Lee

Ben Huson

unread,
Sep 1, 2010, 9:04:40 AM9/1/10
to wordpress-e-c...@googlegroups.com
Lee,

Right you are. Makes sense.
In which case I'm going down the no copy button needed (maybe just a
link and some good documentation on getshopped how to create a child
theme and add templates)

- Ben

Jeremy Smith

unread,
Sep 1, 2010, 11:18:09 AM9/1/10
to wordpress-e-c...@googlegroups.com
I agree with this as well, no copy button, manually copy the files to be changed and leave the rest alone. I think providing some good documentation on theming with the new system is a must.

Thank you,

Jeremy Smith

email: jer...@dnawebagency.com
web: www.dnawebagency.com
tel: 541.690.8628
office: 541.582.8154 ext. 1003

Dan Milward

unread,
Sep 1, 2010, 2:58:41 PM9/1/10
to wordpress-e-c...@googlegroups.com
What about the thousands of dummies that don't use FTP. Who downloaded their theme and WP e-Commerce using  WordPress?


Sent from my iPhone

Lee Willis

unread,
Sep 1, 2010, 3:18:04 PM9/1/10
to wordpress-e-c...@googlegroups.com

> What about the thousands of dummies that don't use FTP. Who downloaded
> their theme and WP e-Commerce using WordPress?

So - even if we allow a "copy" button - without FTP knowledge - they can't
make any customisations anyway ...

Zao Web Design, LLC

unread,
Sep 1, 2010, 3:19:44 PM9/1/10
to wordpress-e-c...@googlegroups.com
Let's think about it in terms of net loss.

Is there any net loss by adding a copy button?  Probably not.

Is there any net loss by requiring users to know FTP.  Probably.

Thanks,

M. Justin Sainton
Zao Web Design, LLC
Principal / Project Manager
http://www.zaowebdesign.com
(c) 971.222.6330
(f) 1.413.723.0396






--

Lee Willis

unread,
Sep 1, 2010, 3:26:50 PM9/1/10
to wordpress-e-c...@googlegroups.com

> Let's think about it in terms of net loss.
>
> Is there any net loss by adding a copy button? Probably not.

I beg to differ. As per my previous reply to Ben. If we push *all* of the
WPEC files out into their WP theme directory, then that user will not see
*any* updates / fixes that we make in the plugin in the future - their
copies will be preferred, and used by WordPress.

If we encourage the user to take across *only* the files they need and
want to change then they will still get all fixes for files that they
aren't overriding - they only miss out on fixes to files they've
customised, and that's unavoidable.

Lee

Zao Web Design, LLC

unread,
Sep 1, 2010, 3:31:08 PM9/1/10
to wordpress-e-c...@googlegroups.com
Then maybe I'm misunderstanding the semantics of a 'copy' button.  I'm thinking of two buttons - "Move Your Theme" and "Backup Your Theme".

"Move Your Theme" does exactly that, it moves the right files to the right places - I don't think I was presuming upon moving every file from WPEC theme to the WP theme folder, rather, "Move Your Theme" would move the right files, with the right structure, to the right places - creating a structure not dissimilar from what you had in your document.  "Backup Your Theme" is essentially just a trust-building tool - anyone at anytime can go click it and know for sure that their theme in it's entirety is backed up outside of the themes folder.

Does that make any more sense?

Thanks,

M. Justin Sainton
Zao Web Design, LLC
Principal / Project Manager
http://www.zaowebdesign.com
(c) 971.222.6330
(f) 1.413.723.0396




--

Lee Willis

unread,
Sep 1, 2010, 3:53:23 PM9/1/10
to wordpress-e-c...@googlegroups.com
> Then maybe I'm misunderstanding the semantics of a 'copy' button. I'm
> thinking of two buttons - "Move Your Theme" and "Backup Your Theme".
>
> "Move Your Theme" does exactly that, it moves the right files to the right
> places - I don't think I was presuming upon moving *every* file from WPEC

> theme to the WP theme folder, rather, "Move Your Theme" would move the
> right
> files, with the right structure, to the right places - creating a
> structure
> not dissimilar from what you had in your document.

OK - so this I still disagree :)

There's no point copying all of the WPEC theme files (I had 6 in my
document - the number could be higher once we theme-ise other widgets, and
other pages like my account etc.) into the user's theme - as I said this
would cause the user to miss out on fixes / updates unnecessarily.

They should only have files in their theme folder that they (or the theme
author) wanted to customise.

So - using my doc as an example, the theme author distributes the
FunkyWordPressTheme theme, with 2 WPEC templates in. These are used by
WordPress to display the category, and single product views. All other
WPEC stuff would be taken from the plugin itself. If the plugin is
updated, then the user will get the advantage of all theme-updates apart
from those two files.

The user then wants to customise the single product view, so he creates a
child theme MyFunkyWordPressTheme, containing just the single product page
template. So, at this point, the single product view comes from the user's
customised theme, the category view comes from the FunkyWordPressTheme
theme, and all other pages use the files provided by the plugin.

If the user installs an updated version of the FunkyWordPressTheme then he
will get the benefit of any improvements the theme author has made to the
category view - although not the single product view unless he ports them
across to his child theme.

Make sense?

Regards
Lee

Jeffry Ghazally

unread,
Sep 1, 2010, 4:16:33 PM9/1/10
to wordpress-e-c...@googlegroups.com
Ok I definitely understand the situation alot better! Thanks lee for taking the time to share your thoughts!
Lees concern is a bog thing actually and spec has suffered from a similar issue with the themes in the upload directory too! He is absolutely correct in his logic, if we roll out a 3.8 next week (not saying this is happening) with a button moving all the template files to the selected theme, then get a great designer to help with making our templates sexy for 3.8.1, most people that have copied their templates in 3.8 won't get the changes. Even if they only customized single-product,,, this was happening in 3.7, and was a pain in the neck, lees suggestion kicks this issue in ye butt! However (you knew Theresa coming din ya)
Lee I'm trying to please every one here so bear with me, what about a checkbox list of files to port to their selected theme?

Best
Jeff

Less screaming more coding
www.screamingcodemonkey.com

Jeremy Smith

unread,
Sep 1, 2010, 4:23:36 PM9/1/10
to wordpress-e-c...@googlegroups.com
Perhaps the "Move Your Theme" button can allow the user to select from a specified number of "themeable" files. Only the files that the user selected could be moved to the new theme.


Lee I'm trying to please every one here so bear with me, what about a checkbox list of files to port to their selected theme? 
... Just read Jeff's response, sounds like he was thinking the same thing I was.

In any case - this does sound like a good compromise. The button would "the thousands of dummies that don't use FTP" :) to move some files while still allowing the other files to be replaced by updates.


Thank you,

Jeremy Smith

email: jer...@dnawebagency.com
web: www.dnawebagency.com
tel: 541.690.8628
office: 541.582.8154 ext. 1003


Lee Willis

unread,
Sep 1, 2010, 4:31:23 PM9/1/10
to wordpress-e-c...@googlegroups.com
> Lee I'm trying to please every one here so bear with me, what about a
> checkbox list of files to port to their selected theme?

I can't really object to that [As long as the default is all un-checked] :)

I think it's work I don't think you *need* to do since anyone who is going
to do customisations need to know FTP to get their changes up there. But
if you want to do it to make things more user-friendly then that's a good
compromise...

Ben Huson

unread,
Sep 1, 2010, 5:29:33 PM9/1/10
to wordpress-e-c...@googlegroups.com
If the copy button is going to have to offer the option of which
templates to copy, maybe this functionality is better suited to a WPEC
Template Pack type plugin afterall?

Also note, you can edit your theme files through the theme editor in
the admin without knowing FTP ;)

- Ben

Jeffry Ghazally

unread,
Sep 1, 2010, 6:03:00 PM9/1/10
to wordpress-e-c...@googlegroups.com
LoL, very true good ol non syntax highlighted theme editor...
Yea I was thinking Theme Pack, but Dan thinks this is something most
users will want, therefore core it goes :)

Dan Milward

unread,
Sep 1, 2010, 6:24:35 PM9/1/10
to wordpress-e-c...@googlegroups.com
I've probably been on the receiving end of more support requests then most people on the planet... and in our forums we still get people asking us "what is FTP". Its painful. I just want to take away as many potential 'pain points' as we possibly can.

Maybe I'm being paranoid. But given the extent of the changes (3.8 vs 3.7) we're already going to be blowing peoples minds. Like everybody else on this list I just want to make sure we hit the right compromise of having something that nurtures the less technical inclined people through the process, and at the same time, is done in a modern WordPress friendly way.

I really appreciate all the thought and input that has gone into this!

Kapai!!!
http://en.wikipedia.org/wiki/M%C4%81ori_influence_on_New_Zealand_English#Other_terms

Ciao,
Dan

On 2/09/10 10:03 AM, Jeffry Ghazally wrote:
> LoL, very true good ol non syntax highlighted theme editor...
> Yea I was thinking Theme Pack, but Dan thinks this is something most users will want, therefore core it goes :)
>
> On 2/09/2010, at 9:29 AM, Ben Huson wrote:
>
>> If the copy button is going to have to offer the option of which
>> templates to copy, maybe this functionality is better suited to a WPEC
>> Template Pack type plugin afterall?
>>
>> Also note, you can edit your theme files through the theme editor in
>> the admin without knowing FTP ;)
>>
>> - Ben
>>
>> On 1 September 2010 21:31, Lee Willis <l...@leewillis.co.uk> wrote:
>>>> Lee I'm trying to please every one here so bear with me, what about a
>>>> checkbox list of files to port to their selected theme?
>>>

>>> I can't really object to that [As long as the default is all un-checked] :)

Reply all
Reply to author
Forward
0 new messages