Active
Project:
Square Grid theme
Version:
7.x-3.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Reporter:
Created:
25 Nov 2012 at 22:28 UTC
Updated:
8 Dec 2012 at 15:22 UTC
Jump to comment: Most recent file
Comments
Comment #1
ianwremmel commentedThis patch should fix the problem, but should perhaps be expanded as, once in place, the UI can no longer be used to change push/width settings in subthemes that use template.php for such overrides.
That said, does it make sense to discourage subthemers from using template.php for this purpose and instead encourage them to use SUBTHEME.info?
Comment #2
laura s commentedThanks for the report. I'll look this over and ponder options. We definitely are in agreement that themers should be able to override the UI-configurable settings.
Comment #3
laura s commentedI was unable to replicate the issue you describe. Here's what I did:
My overrides immediate took.
Could you describe what you're doing? Did you set your grid width settings for your child theme?
Comment #4
laura s commentedComment #5
ianwremmel commentedAre you asking if I set the grid widths in the child theme info file or the child theme settings via the UI?
I probably won't be able to verify anything until at least Saturday, but in either case, I believe setting a grid width will take precedence over the values I assign via template.php.
In my child theme's template.php, I placed the following in spelc_preprocess_page:
Those values get overwritten by squaregrid_preprocess_page because, as far as I can tell, spelc_preprocess_page is getting called before squaregrid_preprocess_page.
As I said, I'll try to confirm this is the behavior I'm seeing on Saturday, but hopefully this info helps.
Comment #6
laura s commentedWith the 3.x branch, you actually don't need to set grid widths in code. I suggest trying removing that code from your child theme's template.php, and setting the width and push values in the child theme's settings page.
My testing shows that preprocess in the child theme's template.php overrides preprocess of the same thing in the base theme's template.php, so I am unable to replicate what you're reporting. It sounds like your code isn't being read at all.
Comment #7
ianwremmel commentedHi Laura, sorry for taking so long to reply. I saw the changes that you made to the documentation indicating that widths should be set from the theme's settings page. While it's certainly convenient in some cases to set widths from there, I'd like to be able to set the widths from my code so I don't have to set them manually or use Strongarm and Features to make my settings deployable (I tried overriding the defaults in my THEME.info file, but that didn't seem to have any effect).
To convince myself I'm not crazy and figure out which hook fires first, I put the following code at the top of squaregrid_preprocess_page and THEME_preprocess_page:
The result was:
spelc_preprocess_page => 2012-12-08T10:03:07-05:00
squaregrid_preprocess_page => 2012-12-08T10:03:10-05:00
As you can see from the timestamps, THEME_preprocess_page gets fired first, so anything set there will be overwritten by the base theme.
I'm not saying my solution above was ideal (it ignored many of the variables set in the info file and on the settings page), but I think increased flexibility in being able to set theme settings from code would make subtheming (and subsequent deployments) easier. If you're interested, I'd be happy to work on a cleaner method than my original patch to support both methods.