Posted by parahumanoid on August 2, 2009 at 11:14am
Hello.
Can someone give me a hint as to why WYSIWYG+TinyMCE may not render in a simple theme written from scratch?
I did enable editor default CSS in all WYSIWYG profiles, as addressed at http://groups.drupal.org/node/21298 , my code does output $scripts and $styles in the head. The editor works in standard themes and the one I recently made using garland as a starting point, but not in the one made from scratch. Any ideas?
Attached is the theme file.
Thank you.
Alex.
| Attachment | Size |
|---|---|
| page.tpl_.php_.txt | 3.76 KB |
Comments
A note
Also, note the erroneous escaping of quotes in the doctype. I removed those backward slashes, but the problem persists. The resulting page was tested as XHTML compliant, so the document is well-formed and compliant.
I think you're forgetting
I think you're forgetting this...
<?php print $closure ?>Yesssss
Thanks, I was having the same problem and this fixed it right up. It's easy to miss something that doesn't directly create visible content when you haven't used Drupal in a while.
Does it matter?
I don't think it's required. I belive it's just a name for one of the default regions, unless you've defined your own. Anyhow, Garland on "Edit node" pages outputs a blank closure, but the editor renders fine, so I don't see how that could influence anything.
$closure is required.
Period.
Daniel F. Kudwien
netzstrategen
$closure
Whether or not you use it as a block region, $closure is required. It contains the output from any hook_footer() and drupal_add_js(... scope='footer') calls.
I notice you're also missing $messages.
Thank you guys
To all of you. Problem solved.
By the way, where can I look up such things as the "required" status of such variables?
Cool. I've forgotten it
Cool. I've forgotten it before myself. I think it had me stumped for a while when I upgraded a 4.7 site to 5.x.
http://api.drupal.org/api/fil
http://api.drupal.org/api/file/modules/system/page.tpl.php/6
Just my 2¢, I would consider all of them required for a "complete" drupal theme, as they each support particular core features. You could make omissions for specific reasons (for example, perhaps you know that "mission" will never be used or your site). Even then, it never hurts to include it. Who knows how a future developer or admin will use your theme? You could save someone hours of future confusion.
That's the point
The template is not general-purpose. Its design includes particular identity, so it is "custom" - only for this one user. He'll never need the mission statement, and even if he does, I am providing life-long support for this template. Like you said, there's no harm in not having a $mission or a $logo feature (as a changeable image, because it can be hard-coded in this case), but, as you pointed out, there's definite harm in omitting $closure. WhileI don't want to be doing extra work for providing features that I don't plan to use, I certainly don't want to miss out on anything vital.
I am beginning to slide off-topic here, but I also wanted to ask about the $left and $right. Do those have meaning only if I haven't defined my own regions, or do they stick around anyway? Do they have any, besides outputting regions, hidden semantics like was the case with $closure.
Thank you for all your help.
Alex.
I somewhat agree on $mission
I somewhat agree on $mission and $logo. I don't always leave those in if I modify the page template. Although these days I rarely build a custom page.tpl.php. Just be aware that if your clients ever see the core admin options, they may get confused if they don't work.
$left and $right are regions that are defined in your .info file or your parent theme's .info file. If they are in the .info file, Drupal expects them to be available. If you don't intend to use them, be sure and remove them from the info file, otherwise they'll appear as options in the block administration and other places. Look at the core themes for the regions[] definitions to see what I mean...
Someone correct me if I'm wrong, but it looks like core doesn't explicitly define the left and right regions. It will add the $layout variable ('left', 'right', or 'both') in template_preprocess_page() if they are present, but it does not create them.
Same issue
I have the same issue. I started with the theme Ablock and worked from thereon out. TinyMCE works in Garland but not in my theme, see the attached page page.tpl.php.
I do have closure in my template.
Anyone?