[英]Drupal 7 how to add content in custom theme
我在drupal 7中開發自定義主題。
我有.info
, page.tpl.php
和style.css file
。
我想在主題中添加內容(來自管理面板文章和其他內容) 。
我該怎么做? 我添加了print render($page['content']);
在page.tpl.php
但是它不起作用。
您需要在.info文件中聲明區域,
name = themename
description = Your theme description.
version = 7.x
core = 7.x
stylesheets[all][] = css/style.css
scripts[] = js/yourscript.js
regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
然后清除緩存,以免影響更改。
您可以使用相同的<?php print render($page['content']); ?>
<?php print render($page['content']); ?>
用於顯示page.tpl.php中的內容
在那之后去admin-> structure-> blocks
將“主頁內容”分配給“內容”塊
更詳細的文檔在這里。
請遵循文件夾和文件的命名結構。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.