随笔分类 -  Drupal

摘要:As we know, Drupal7 has changed a lot, and we have to be familiar with it.Here is an example to theme a table with pager.$output='';$header=array(array('data'=>t('Title'),'field'=>'n.title',),array('data'=>'',),);$query=db_select(' 阅读全文
posted @ 2011-05-09 22:14 DavidHHuan 阅读(23563) 评论(2) 推荐(0) 编辑
摘要:look in the source of the d.o theme: <!DOCTYPEhtml><htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en"lang="en"dir="ltr"><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><metahttp-equiv=&q 阅读全文
posted @ 2011-03-31 11:41 DavidHHuan 阅读(666) 评论(0) 推荐(0) 编辑
摘要:When trying to print the date with formate_date as below:<?phpprintformat_date(time(),$type='custom',$format='dFY',$timezone=NULL,$langcode='fr');?>I only can get this result:09March2011The word "March" is in English, but not in French.It is not working for me 阅读全文
posted @ 2011-03-09 11:21 DavidHHuan 阅读(323) 评论(0) 推荐(0) 编辑
摘要:Here i will try to get the taxonomy ID from the path.1) In the view admin page under arguments click on the Taxonomy: Term ID argument and scroll down the page where you’ll see some options for that argument under Defaults: Configure Argument Taxonomy: Term ID.2) Under Action to take if argument is 阅读全文
posted @ 2011-03-02 14:09 DavidHHuan 阅读(411) 评论(0) 推荐(0) 编辑
摘要:As we know, Drupal does not seperate the frond-end and back-end totally, so the theme of front-end and back-end is the same, though you can set the Administrator theme inadmin/settings/admin/theme, there is still some situation that will make you crazy, you can see my another article about it.[Drupa 阅读全文
posted @ 2011-01-22 11:19 DavidHHuan 阅读(322) 评论(0) 推荐(0) 编辑
摘要:As we know that, in Drupal, it does not separate the front-end and back-end. Though we can set the back-end theme, but some time, it still displays the front-end theme, for example, when deleting a node, it will display the front-end theme but not the back-end theme you wish to, here is a way to bui 阅读全文
posted @ 2011-01-18 17:34 DavidHHuan 阅读(315) 评论(0) 推荐(0) 编辑
摘要:The order of loading preprocessorstemplate_preprocess- This is supplied by core and always added. The variables generated here are used for every templated hook.template_preprocess_hook- The module or core file that implements the theming hook supplies this. The initial generation of all the variabl 阅读全文
posted @ 2011-01-10 11:32 DavidHHuan 阅读(300) 评论(0) 推荐(0) 编辑
摘要:1. Install the devel module and enable it.2. Make sure that in your themes, page.tpl.php for example, you have the code as below:[代码]3. Where you want to see the sub-variables of a variable ($vars here is an example), just use the code:[代码]Note: When in Drupal 6, just remember if you put it in phpte 阅读全文
posted @ 2011-01-06 17:44 DavidHHuan 阅读(495) 评论(0) 推荐(0) 编辑
摘要:cck (embed in the kernal in drupal 7)The Content Construction Kit allows you to add custom fields to nodes using a web browser.viewsThe Views module provides a flexible method for Drupal site designers to control how lists and tables of content (nodes in Views 1, almost anything in Views 2) are pres 阅读全文
posted @ 2011-01-04 18:46 DavidHHuan 阅读(402) 评论(0) 推荐(0) 编辑
摘要:Drupal 6:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--//ThiswilladdaJSfiletoyourhead(specificallythe$scriptsvariableinpage.tpl.php)drupal_add_js(drupal_get_path('module','my_module').'/my_module.js');//ThisaddinlineJStotheheadofthedocumentdrupal 阅读全文
posted @ 2010-12-14 15:48 DavidHHuan 阅读(561) 评论(0) 推荐(0) 编辑
摘要:If you are creating a function that you intend to be strictly private (i.e. no other module should rely on it being a stable function or call it), start the function name with "_your_module_name_". If... 阅读全文
posted @ 2010-10-20 15:20 DavidHHuan 阅读(280) 评论(0) 推荐(0) 编辑
摘要:1. Scene of building a theme.代码2. Build a function: hook_theme()[代码]3. Build a function: theme_hook()[代码] 阅读全文
posted @ 2010-10-08 18:25 DavidHHuan 阅读(275) 评论(0) 推荐(0) 编辑
摘要:As we know, in drupal, the frontend and backend are mixed together, but when we click the button "delete" or "revisions" of a node, we are redirected to frontend, so how can we set to stay in backend ... 阅读全文
posted @ 2010-09-15 18:14 DavidHHuan 阅读(300) 评论(0) 推荐(0) 编辑
摘要:Change the URL for the admin panel: /admin/ will be no more accessible. The goal is to avoid hacks.Let say we want to change the entry of backend from /admin to /config, that is the web user is deny w... 阅读全文
posted @ 2010-09-09 16:07 DavidHHuan 阅读(364) 评论(0) 推荐(0) 编辑
摘要:First you have to create a new module called "my_submit", and in the my_submit.module, insert the code as below:代码I have added readMe in the code comment. 阅读全文
posted @ 2010-09-08 11:19 DavidHHuan 阅读(498) 评论(0) 推荐(0) 编辑
摘要:Modify the file, sites/all/modules/date/date_elements.incfunction date_combo_validate(), maybe line 521,after the code[代码]add these:[代码]sites/all/modules/date/date.themefunction theme_date_display_com... 阅读全文
posted @ 2010-09-07 20:52 DavidHHuan 阅读(274) 评论(0) 推荐(0) 编辑
摘要:When I insert a wrong url to the server, I got the error as blow : [代码]And then I check the log of apache, I got some notice : [代码]Thanks for Google, I got the resolve.Open the .htaccess files, we can... 阅读全文
posted @ 2010-09-01 13:48 DavidHHuan 阅读(493) 评论(0) 推荐(0) 编辑
摘要:1. Enable these module : Content type translation, Content type translation2. Edit the content type which you want to change the languageFor example, here we modify the "Pages" content type. a. In the... 阅读全文
posted @ 2010-09-01 10:50 DavidHHuan 阅读(382) 评论(0) 推荐(0) 编辑
摘要:after I modified the 404 page redirection in admin/settings/error-reporting , when I view a page which doesn't exist, that will correctly redirect to the node what I set, but some blocks disappear.The... 阅读全文
posted @ 2010-08-27 16:53 DavidHHuan 阅读(309) 评论(0) 推荐(0) 编辑
摘要:Just test the code as below:代码Have fun! 阅读全文
posted @ 2010-08-23 14:16 DavidHHuan 阅读(393) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示