By ryooki on
I'm using the goofy theme right now and the mission statement doesn't show. Is there anyway to get it to display with the node view / front page only? I don't want it to display at the top of every page like in the Slurpee theme.
Thanks!
Comments
phptemplate or xtemplate
Are you using phptemplate (must have installed yourself) or xtemplate (comes with Drupal core) theme?
--
Get better help from Drupal's forums and read this.
I have both template engines
I have both template engines installed. However, I'm not sure which one goofy uses. It's called "goofy.theme," and it accesses "style.css."
This will do
This will do it:
variable_get("site_mission", "");Use if statments to show it only on some pages:
Use this to show on node view pages:
I don't know if there is a better way of doing this for the front_page, but I will use an 'if' statment wit '$node->nid == x' where x is the node's id of the page that you will use as the front page.
Hope some of this helps.
---
Robert Garrigos
Personal site:www.garrigos.org
Admin of: www.escolasafa.info - www.societatbach.org
Thanks!
This really does help. I had to use:
if ($node->type = 'page')
for some reason instead of the ==. I don't know php at all, but I'll try to look it up. Actually, I don't even know if this is in php. I can't get the
if ($page)
to work for some reason, but this is definately a start.
Thank you, thank you, thank you! :)
OK nevermind
Apparently, I can't get either if statement to work. I'm not sure, but I'm guessing it has something to do with the fact that I'm working in the goofy_body section which is titled goofy_body($content). I'm guessing that means the $main, and $page, and $node are not passed to this particular function. But then, I could just be guessing totally the wrong direction. Erg... programing without understanding what's going on is very difficult!
I'm feeling guilty for asking questions over and over when I'm a newbie who's programming knowledge is not very advanced. I feel like I should be able to figure more of this out on my own, but... it's hard. :(
I don;t think goofy is
I don;t think goofy is phpTemplate based, I believe it is one of the old plain php based direct theme's so some of the stuff answered for you may not be relevant. If it is phpTemplate based, then you would have to hard code the mission statement links into the goofy theme yourself.
Here is the plain php theme's page http://drupal.org/node/11795 with more information.
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
you're right, it's not
You're right, it's non phptemplate based. Thank you for showing me that node, I didn't even realize the documentation exsisted! I looked back to find it, and it was under "Help with Development" or "Developing for Drupal" which I assumed was for people were interested in developing the overall Drupal community (ie getting CVS access or something)! (sigh) The entire time, I've been trying to reverse engineer the whole thing from differente themes / modules. God! How sad! What wasted effort! I could have used all that effort towards learning and programming instead of trying to figure out the structure.
From the handbook link on
From the handbook link on the top of the page, there is a heading of Developing for Drupal and one of the links displayed there is the Theme Developers Guide
Anything to do with 'custimization' is viewed as developing something. I'm not sure how we can make this more obvious. Breaking out into another handbook is not really the answer as then 'everything' would need it's own handbook so to speak.
What were you looking for when you went looking?
In any case, the effort wasn't really wasted. Think of it like looking at the engine parts of a car before picking up the manual of how it goes together. Now you can jump right to the part without having to look for it. :)
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Newbie's view
If you look at handbook again, there is a category for "Configuration and Customization," and under that, there's "Developing for Drupal."
See, as a newbie who is not in-tune with developer or open source lingo, I thought "Config & Customization" is where'd I go to look at getting things exactly as I want, and then if I wanted to program or write for the drupal community at large, I'd go on to "Developing." When I explored the handbook originally, I saw that it was targeted towards beginners and basic stuff. I looked and looked at the Module section over and over, and it helped somewhat. A link in there for "building your own modules" that directed you to the module developer's guide would be nice.
Something in the basic Handbook like, The Advanced User or Advanced Beginner's guide to customizing Drupal. "You've installed Drupal and got it working. You're added a module or two, and maybe you're even changed the theme around. Now it turns out, you want to do more and adding modules or changing the options don't seem to cut it. Maybe you've found that things don't look quite like you want, or you want there to be more functionality in a particular module. Now, you've entered the realm of developing Drupal, or customizing the code to suit your needs. Look at the Contributer's Guide to start, and you may end up with something we all can benefit from."
Adding Mission to .theme pages in Drupal 4.7
I just used this info to add the mission statement to a theme in Drupal 4.7, to be displayed on the front page only:
First I added
'toggle_mission'to thethemename_featuresfunction, then added the following inthemename_page:The
drupal_is_front_pageappears to have been introduced in 4.7, so this probably won't work in older versions.Micah
thegreenbag.com | skinnykidracecars.com