I'm building a custom zen sub-theme and I'm using Drigg http://drupal.org/project/drigg as one component of my site. The author has built his own custom theme for the module so I am trying to incorporate elements of it into my design. Before I try and pull his template files apart and patch the php functions and whatnot into zen, has anyone else already made custom Zen/Drigg templates? Or anyone have ideas on the proper way to start so I don't have updating problems later? I have just about zero php experience, so making sure I preserve the functionality without throwing in a bunch of extra junk code into my site is paramount.
Comments
Comment #1
hokuspokus commentedSo to start with the template.php is
and looks pretty basic and may already work without modifying Zen.template.php.
The functions that I am trying to merge into Zen come from his page.tpl.php file.
Obviously I don't need his header layout functions since they are taken care of in zen, but the module specific sections seem problematic to me. Take for example
would this be a function I would try to import into Zen? It doesn't seem like it, it seems like something I would just drop in a block, but maybe I am wrong and Zen would handle this as well.
FYI, the main reason I'm here is that the module author apparently has no theming experience and has referred all theme questions to the forums. My theme is Zen based, so here I be.
Thanks all
Comment #2
hokuspokus commentedNo help on this one, or is this the wrong place to ask these types of questions?
Comment #3
hokuspokus commentedOkay, so one more hint from the documentation for Drigg:
If no one can help with the specifics of this module and Zen, can anyone point me to a verbose guide for importing functions into Zen? I know michelle from advanced forum/profile had trouble getting her stuff in and she is a far better coder than I, but I can at least poke around and see what I can work out....with a little guidance of where to start.
Comment #4
johnalbinMy guess would be that Drigg is using path_to_theme() to find the template files. ?
But path_to_theme() returns the path to Zen and not the path to the sub-theme. So either change Drigg to use path_to_subtheme() (which won't work if you are using any non-Zen themes) or try putting the drigg_theme directory in the zen directory instead of your sub-themes directory.
thankfully, this kind of module/theme interaction become super easy in D6. Its just D5 that has no mechanism for a module to alter the theme.
Comment #5
hokuspokus commentedThanks John, that's a starting point at least. I'll work on it a bit and see what I can come up with.
Yep. It will be nice to not have to mash stuff like this together anymore. Come on Future, get here now!
Comment #6
yoroy commentedCleanupup: closing older support requests, feel free to re-open if needed.
Comment #7
socialnicheguru commenteddid you ever get this working? I am looking at the same thing.
Comment #8
hokuspokus commentedSorry no, I ended up just modifying the custom theme the Drigg author packaged with his module. At the time I didn't have the skill or the time to go through and build a zen-based drigg theme. The stock drigg themes went through some changes as well to add functionality, so in the end it turned out to be a good thing I didn't work too hard on building a separate Zen theme.
Comment #9
johnalbinWith the changes in Drupal 6's theme system, it could be possible that the Drigg module would no longer need a specific Drigg theme. But that's pretty far outside the scope of the Zen theme. :-\
Comment #10
hokuspokus commentedYeah, I'm migrating my site to 6 right now, finally time to make the jump and work all this out. Converting the Drigg Theme to a new custom theme I building off the Zen 960 subtheme. So far things are MUCH easier to figure out as far as theming goes in Six. Keep those interested posted in how it all turns out, should be about a week (since I am learning as I go still.)
Comment #11
slicedsoup commentedWhat is the current status on the use of Drigg with a Zen based theme?
It would be great to have a setup guide for Zen or a basic Drigg-Zen theme to download.
Comment #12
hokuspokus commentedI messed around with it and you can see the results here: ecoevolution.org/news (I still have to clean up the vote button a bit, still ugly.) I used Zen and the 960 subtheme, but I would have to look at how I did it again to see if there was a way to give a step by step. Basically I created page templates specifically for the news section and styled it that way, moving stuff to where I needed it and tweaking it here and there.
I can give more details if you need them
Comment #13
slicedsoup commentedThat's great hokuspokus, it would be great to get a step by step on this if that's possible. I'm sure there are many other Driggers out there that would help tweak this into a guide and maybe even a new Drigg theme to download.
Comment #14
Mars2012 commentedHi,
I was looking for Drigg theme information and FINALLY I found this Issue.
I have a simple question.
How can I change my Drigg theme to adapt from 3 columns to 1,2 or 3, depending if it has blocks or not, like the Garland does.
Congratulations hokuspokus for your webpage.
Comment #15
hokuspokus commentedHi guys,
I'm running through my site now trying to remember how I set things up. This might sound a little convoluted but hopefully it will help a bit in understanding the drigg layout.
Here are the basic tools that you need to start building your own Drigg theme.
1. Firebug addon for Firefox- shows you the elements on the page and the CSS that controls them
2. Devel module for Drupal- most importantly, the theme developer tool. This shows you what template is being called and what to name a new template file if you want to change a page around. http://drupal.org/project/devel
3. Grab yourself a copy of Zen and zen960 themes, or any other base theme that lets you build up from scratch. http://drupal.org/project/zen , http://drupal.org/project/zen_ninesixty
For Drigg, you will have at least two different page templates (layouts) on your site: one for your Drigg newstream pages and one for every other type of content you have (if you have more than one type of content like I do.)
Page templates control the placement of everything on the page and reads from top to bottom in the order that things appear. They are found in your theme folder, Drigg has two included; drigg-theme and 4plus. Open the template files and look for the major sections like "head" and "content" and you will start to see how things are laid out on the page or within a node. Anything with a "print" command will be printed on the page as well, so that can help you see where things are going, section by section.
For my site and Zen using the Zen960 subtheme, I created several templates to handle drigg content, which are based off the ones found in the stock themes folder of Drigg, specifically node-drigg.tpl.php and page.tpl.php. The node template controls the appearance of the individual drigg stories or nodes, and the page template controls how the category menus, drigg river of news stream, sidebars, etc appear.
Enable Drigg and the stock drigg themes and start poking around with Firebug, Devel and a text editor and see how changing/moving things affects the layouts. Then you can start to get an idea of how to make things look how you want for Drigg. Don't be afraid of the crazy programmy talkin' in the templates, I don't know a thing about programming in php and I was able to crack this nut and make the site you saw. Keep asking questions here and I will help as much as I can.
Hokus
Comment #16
gizmoraft commentedI managed to create a fully functional drigg theme in under a day, it's not fully designed, just putting some finishing touches before letting people use the service, but you can check it out and give some feedbacks. http://watsey.com
Comment #17
Mars2012 commentedCongratulations for your work in less than one day.
You start with a Zen based theme or you change the drigg theme?
Beside this I have a question:
How do you put the four columns (About WatSey, Business, Legal and Get Involved) in the footer?
You achive that with a module? If yes, which one?
Thanks.