drupal-theming

Style Drupal 7 log-in page

余生长醉 提交于 2019-12-20 14:11:51
问题 How do I style the login-page of Drupal 7? I used different methods like page-user-login.tpl or user-login.tpl of page-login.tpl but with no results. Is there an easy way to theme your login page in Drupal 7 in his own .tpl -file? 回答1: You can override any page template by naming your templates in the following convention: For page 'user/login': page--user--login.tpl.php For page 'foo/bar/' page--foo--bar.tpl.php See Core templates and About overriding themable output for more information.

Injecting field content to html.tpl.php in Drupal 7

懵懂的女人 提交于 2019-12-14 02:35:01
问题 I'm trying to make one content type that can reuse a jQuery-gallery with different styles depending on what page you're on. So i made one field called field_CSS where I put the CSS. However for performance reasons (and for the sake of cleaning up the code) I want to put it in the HEAD-section. The content in the head section is rendered in the html.php.tpl-filde and the field is in the content type of the specific node. I've tried <?php print render($content['field_CSS']) ?> <?php print

custom page-xxxx.tpl.php doesnt works

时间秒杀一切 提交于 2019-12-13 16:15:15
问题 I have page named page--news.tpl.php, which i created for my news page. But after i cleared my cache, page still not using, and drupal use the original page.tpl.php. Any ideas how to solve it? 回答1: An alternate way of doing it, is through preprocess hook with few lines of code. Here's how it goes function <module_name>_preprocess_page(&$variables) { if (isset($variables['node'])) { $variables['theme_hook_suggestions'][] = 'page__'.$variables['node']->type; } } Suppose you have a node type as

How to onclick-trigger a non-native jQuery plugin's action?

寵の児 提交于 2019-12-13 07:46:13
问题 I've installed a 3rd-party jQuery plugin (it's an accordion). It displays on my page, and works as expected. I want to trigger one of the plugin's actions (open a particular slide) when I click on an image on my page. I can't seem to get the code &/or syntax for doing that right. The plugin I've installed is "EasyAccordion" (http://www.madeincima.eu/blog/jquery-plugin-easy-accordion/). It's .js source is posted here: http://pastebin.com/55JB4pr2. I'm using the plugin on a Drupal7 page. I don

Drupal 7 How to use render element instead of variables in hook_theme()

余生长醉 提交于 2019-12-13 03:55:46
问题 I'm having trouble understanding the 'render element' key purpose when implementing hook_theme(). function personal_news_theme($existing, $type, $theme, $path) { return array( 'teaser_list_by_user' => array( 'render element' => 'element', ), ); } I did my research and the way I understand it, the render element key is use when creating a theme function to modify another theme function's output ONLY! And there's no way to use it as to implement a new theme function. If I'm wrong, how can I use

Drupal Display Modified Date for Node

早过忘川 提交于 2019-12-12 18:55:59
问题 Is there a simple way in Drupal to display the last modified date for a node as part of the node.tpl.php file? 回答1: If you put this code in the node.tpl.php file it will show the date of the last change to the node: <?php echo format_date($node->changed); ?> with whatever HTML you want around it. 回答2: If you place below code in you node.tpl.php file - <?php $node = node_load($nid); echo $node->changed; ?> you will get the timestamp and i think that can be changed to date. Here $nid in tpl

Including results along with a form on the same page and theming the results using drupal

半世苍凉 提交于 2019-12-12 10:23:15
问题 I have successfully created a page in drupal that displays a form and results on the same page. The form acts like a filter of the results. The results include a bunch of html that includes google charts via the Chart API module (http://drupal.org/project/chart). The results are included in the form via a markup form element (Got that from eaton's comments here: Drupal: How to Render Results of Form on Same Page as Form). Since I can't access the form results outside of the scope of the form

How to theme a menu block in Drupal?

纵然是瞬间 提交于 2019-12-12 09:17:25
问题 This should really be a basic question but I simply don't get it after hours of searching. The question is, how do I theme menu blocks in Drupal 7? I've created three different blocks all based on the main menu. Now I want to: create unique HTML for all three blocks, that means modifing the surrounding wrapper and the <ul> and <li> that builds the menu. I wanna set special classes and remove all of the Drupal-added stuff attach different classes to the different levels within each block. One

Using jQuery with CSS in Drupal 7 “Zen” theme

て烟熏妆下的殇ゞ 提交于 2019-12-11 14:08:32
问题 I'm editing the "Zen" theme in Drupal 7. And that's the problem: (function ($, Drupal, window, document, undefined) { alert("xuy"); $("#navigation ul.links li").hover(function() { alert("xuy"); }); The first alert is working well, but there is no alert on hover. I've got this class in CSS. Even $("a").hover(function() { alert("xuy"); }); Didn't work. 回答1: Your code looks a little funky to me. Shouldn't you be using drupal behaviors in drupal 7? (yes you should). Drupal.behaviors.mybehavior =

How to modify Drupal site on OpenShift using SFTP?

亡梦爱人 提交于 2019-12-11 13:13:11
问题 I have Drupal 7 set up on my OpenShift account using the Drupal 7 quick start. I have set up WinSCP to navigate the directory, and I can get to app-root/data/sites/all/, which is where custom Drupal mods go. I've installed the Zen theme as well. However, when I try to change any of the template files in app-root/data/sites/all/themes/zen/templates, none of the changes show up at my site's publicly accessible URL. I've tried clearing the Drupal cache and the browser cache, but still it doesn't