Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

Drupal : フロントページのカスタマイズ

[追記]:さらにフロントページのデザインを変更しました。現在は、こちら

Drupal の標準のフロントページは、各エントリーを新しい物から順にティーザー(概要)表示するだけの単純なものだ。1ページあたりの表示エントリ数は指定できて、各ページの下部に簡単なページャが作成される。

最初はこれでよかったが、いろいろな記事を書きためていってエントリ数が増えてきたので、少しカスタマイズすることにした。正確にはカスタマイズではなく、新たにページを作成してそのページをデフォルトのフロントページとして設定し直している。

標準のフロントページは下部にページャがついているが、2,3ページならともかく、10ページ以上にもなると使い勝手が悪く、あまり役に立たない。そこで、最近のエントリだけ残して、古い記事はアーカイブページへ追いやってしまうことにした。フロントページだけ見ればよいようにしてページャを使うことをやめた。

ティーザー表示でもあまり数が多いと重くなるので、最新の4エントリのみをティーザー表示とし、次の10エントリはタイトルだけ表示している。そして、一番下にアーカイブページへのリンクを置いた。

frontpage screenshot

実現方法だが、DrupalのPanelモジュールを使ったページを作っている。3つのコンテンツを一つのパネルページに入れている。一つめは最新4エントリのティーザー表示で、これはViewsモジュールでBlockを作成した。2つめは、次の10エントリのリスト表示で、これもViewsモジュールでBlockを作成した。3つめはカスタムコンテンツで、これは単にアーカイブページへのリンクを1行書いただけのものだ。

アーカイブページ自体は、これとは別に以前から作ってあった物で、これもViewsで実現している。

Viewsのコンテンツは独自にキャッシュ機構を備えているので、これも使っている。最近、サイトへのアクセスが重たく感じるようになったのだが、これで少しは軽くなったのではないかと思っている。

PAGE TOP