Teljesítménygyilkosok 1. - Főoldal kialakítása

The spam filter installed on this site is currently unavailable. Per site policy, we are unable to accept new submissions until that problem is resolved. Please try resubmitting the form in a couple of minutes.
Kategória: 
Leírás

Miután jó ideje foglalkozok teljesítmény optimalizálással (is), gondoltam legyen egy sorozat a könnyen elkövethető hibákról. Már csak legyen kedvem tovább írni. :)

Az első részben egy olyan hibával foglalkozunk, amibe olyan könnyen bele lehet szaladni, mint Frisco Joe Bud Spencer öklébe.

A feladat a következő, írjuk át a drupal főoldalát, egyáltalán nem kell az y mennyiségű node teaser lista, teljesen egyedi felépítésre van szükségünk, mint például az index.hu címplapja.

Ennek az egyik lehetséges módja (amivel teljesen nem értek egyet, mert oldszkúl, nehezen skálázható, nehezen karbantartható, könnyen lehet benne hibázni), hogy saját page-front.tpl.php-t (d6) készítünk, szépen összerakjuk benne a layoutot, és mindenki boldog - csak a rendszergazda veri a fejét a falra, hogy ventillátor kiszédül a szerverből.

És itt jön a gáz: Hogyha a site configuration-ben nem állítunk semmit, az alapértelmezett 'node' oldal marad a főoldal.

Gondold csak végig!

Amikor beindul a drupal, szépen lekérdei az adatokat, amiket a főoldalra neki működési logika alapján ki kell írnia, lerendereli, ezek ott vannak futás során a memóriában, eljut a sminkrétegig és? - Egyszerűen nem csak nem lesz kiírva, mert nincs benne a saját .tpl.php-nkban! Magyarul vagy 20 node-ot elmaszatoltunk sminkrétegből.
Ez azért főleg drupal6-on drága mulatság tud ám lenni, ha pl van 5-6 content type 20-30 mezővel, amik folyamatosan a főoldalra küldenek tartalmakat.

Tehát ha egyedi főoldalad van, és az Oldalbeállításoknál node a főoldal, akkor bizony erőforrást pazarolsz, ami jelentős oldalgenerálási idő növekedést okozhat.

Ebből következik a megoldás is, így vagy úgy takarítsd el a node oldalt a főoldalról:

Panels + Page Manager

Használj panels + page_managert! (d7-en mindenképpen) Skálázható, könnyen módosítható, fenntartható, hosszú távú megoldás (igen valószínű, hogy lesz hozzá update path d8-ra), exportálható, bővíthető. Egyébként a panels részét nem is muszáj használni, ha létrehozol egy mezei home oldalt page managerrel, és nem adsz hozzá variantot, már működni fog.

Node használata

Küldj be egy page típusú node-ot, és állítsd be főoldanak. Ezt csak a nálam is lustábbaknak, egy page típusú node is tartalmaz jónéhány olyan dolgot, amire itt nincs szükségünk, pl felesleges body mező, de akkor már jár hozzá node szintű jogosultság ellenőrzés, lesz egy rakás felesleges tabod.

Saját modulból

Csinálj egy saját modulban saját útvonalat, ami nem csinál semmit. Nekem ez a személyes kedvencem, ha panelsfóbiás oldalon kell dolgozni. Hogy miért? Ezért. Pontosan azt csinálja, ami nekünk kell, se többet, se kevesebbet.

Ehhez mindössze ennyit kell kódolni:

[geshifilter-drupal6]function MYMODULE_menu() { $items = array(); $items['my-home-path'] = array( 'title' => t('Home'), 'description' => t('Home page of MODULE'), 'page callback' => 'MODULE_home', 'access callback' => TRUE, ); return $items; ); function MODULE_home() { return 'Home page'; #csak ha netán valami gyász lenne, tudjuk, ne egy tök pucér oldalunk legyen }[/geshifilter-drupal6]

Temészetesen az ilyen-olyan módon létrehozott path-et ne felejtsd el beállítani kezdőlapnak!

Ezzel a példával azt is próbálnám szemléltetni, hogy milyen könnyű elcseszni valamit drupalban. Sokszor van találkozik az ember egy problémával, kiguglizza/megkérdezi fórumon, ám nem gondol bele a mellékhatásokba.

Hozzászólások

ブランドスーパーコピー通販スーパーコピーブランド専門店!

ブランドスーパーコピー通販スーパーコピーブランド専門店!

2018グッチコピー新作バッグ、グッチスーパーコピー財布偽

2018グッチコピー新作バッグ、グッチスーパーコピー財布偽物激安通販

スーパーブランドコピー専門店_楽天スーパーコピーブランド

スーパーブランドコピー専門店_楽天スーパーコピーブランド

Schwab Clever Portfolios

Schwab Clever Portfolios invests in Schwab ETFs.

I was wondering if you ever

I was wondering if you ever thought of changing the structure of your website?
Its very well written; I love what youve got to say. But maybe
you could a little more in the way of content so people could connect with it better.
Youve got an awful lot of text for only having 1
or two pictures. Maybe you could space it out better?

スーパー

スーパー コピー,ブランドコピー,スーパーコピーブランド,ブランドコピー激安,
http://www.centrumkb.pl/2016/ http://www.centrumkb.pl/2016/

ブランドスーパーコピー

ブランドスーパーコピー 財布代引き口コミ-国内発送
http://receptizasvakog.com/page/56/ http://receptizasvakog.com/page/56/

Financial advisors enterprise

Financial advisors enterprise is folks business.

人気ブランドコピー順子店鋪SALE-SHOPS!スーパーコ

人気ブランドコピー順子店鋪SALE-SHOPS!スーパーコピー時計、財布、バッグ通販 当店は10年も経営して百万顧客に評価された老舗でございます。
http://www.mindywenderfitness.com/388340337/ http://www.mindywenderfitness.com/388340337/

Good day! This is my first

Good day! This is my first visit to your blog! We are a group of volunteers and starting a new project in a community in the same niche.
Your blog provided us useful information to work on.
You have done a extraordinary job!

And this is an funding danger

And this is an funding danger value taking.

Thanks for your personal

Thanks for your personal marvelous posting!
I seriously enjoyed reading it, you could be a great
author.I will remember to bookmark your blog and will often come back at some point.
I want to encourage that you continue your great job, have a nice afternoon!

All varieties of investments

All varieties of investments include sure risks.

Pretty! This was an

Pretty! This was an incredibly wonderful post. Thanks for supplying these details.

A financial advisor is your

A financial advisor is your planning partner.

人気ボッテガコピー、ファッションマガジンでも有名なブランド

人気ボッテガコピー、ファッションマガジンでも有名なブランドの激安偽物通販店です。

スーパーコピー時計は2年無料保証になります。ロレックス、ウ

スーパーコピー時計は2年無料保証になります。ロレックス、ウブロ、パネライ、ガガミラノスーパーコピー時計等ブランド時計コピー。

If you are going for finest

If you are going for finest contents like myself, simply
go to see this website daily since it presents quality contents, thanks

Thank you for some other

Thank you for some other fantastic post. Where else
could anyone get that type of information in such a perfect manner of
writing? I've a presentation next week, and I'm on the look for such information.

ブランドコピー時計,ブランドコピー財布,ブランドコピーバッ

ブランドコピー時計,ブランドコピー財布,ブランドコピーバッグ,ブランドコピー代引き,韓国ブランドコピー商品販売.

Now it's time to decide your

Now it's time to decide your particular investments.

ブランドコピー市場

ブランドコピー市場

Hi everyone, it's my first go

Hi everyone, it's my first go to see at this website, and
article is actually fruitful in support of me,
keep up posting these types of articles or reviews.

\n \n maglie calcio

\n \n maglie calcio bambino \n \n \n \n \n billiga fotbollströjor \n \n \n \n \n maglie calcio a poco prezzo \n \n \n

Traders do pay direct and

Traders do pay direct and indirect costs.

Pretty nice post. I just

Pretty nice post. I just stumbled upon your blog and wished to mention that I've
truly enjoyed browsing your blog posts. In any case I'll be subscribing
in your feed and I hope you write once more very soon!

This paragraph will help the

This paragraph will help the internet viewers for setting up new web site or even a weblog from start to end.

First of all I want to say

First of all I want to say superb blog! I had a quick question that I'd
like to ask if you don't mind. I was curious to know how you center yourself and clear your mind before writing.
I've had trouble clearing my mind in getting my ideas out there.
I do enjoy writing however it just seems like the first 10 to 15 minutes are lost simply
just trying to figure out how to begin. Any ideas or tips?
Thanks!

A financial advisor is your

A financial advisor is your planning associate.

Simply wish to say your

Simply wish to say your article is as astonishing.
The clarity for your post is simply cool and
i could assume you are knowledgeable on this
subject. Well along with your permission let
me to grab your feed to stay updated with
impending post. Thank you a million and please carry on the rewarding work.

Hi, i think that i saw you

Hi, i think that i saw you visited my website thus i came to “return the favor”.I am trying to find things to improve my site!I suppose its ok to use some of your ideas!!

Its such as you read my mind!

Its such as you read my mind! You seem to know a lot approximately this, such as you
wrote the ebook in it or something. I feel that you just could
do with a few p.c. to drive the message home a bit, however instead of that, that is great blog.
An excellent read. I'll definitely be back.

Article writing is also a

Article writing is also a excitement, if you be familiar with then you can write if not it is difficult to write.

Asking questions are in fact

Asking questions are in fact pleasant thing if
you are not understanding something entirely, except this article offers fastidious understanding yet.

whoah this weblog is great i

whoah this weblog is great i like studying your posts. Stay up the good
work! You realize, a lot of individuals are hunting round for this
information, you can aid them greatly.

I visited various sites but

I visited various sites but the audio feature for audio songs current at this web page is actually marvelous.

All kinds of investments come

All kinds of investments come with certain risks.

I like the helpful info you

I like the helpful info you provide in your articles. I'll bookmark your blog and check again here
regularly. I am quite sure I'll learn many new
stuff right here! Good luck for the next!

Hi would you mind letting me

Hi would you mind letting me know which webhost you're using?
I've loaded your blog in 3 completely different internet browsers and I must
say this blog loads a lot faster then most. Can you suggest
a good web hosting provider at a fair price?
Thank you, I appreciate it!

All kinds of investments

All kinds of investments include sure risks.

I am no longer certain the

I am no longer certain the place you are getting your information, but
good topic. I needs to spend some time learning more or working out more.
Thank you for magnificent information I used to be in search of this information for my mission.

Hi there, You have done a

Hi there, You have done a fantastic job. I will definitely digg it and personally recommend to my friends.
I'm confident they will be benefited from this website.

Financial advisors business

Financial advisors business is folks business.

Hi! I've been following your

Hi! I've been following your web site for a long time now and finally
got the courage to go ahead and give you a shout
out from Dallas Tx! Just wanted to mention keep up the good work!

whoah this weblog is

whoah this weblog is wonderful i like studying your posts.
Keep up the good work! You realize, a lot of persons are looking around for this
info, you can aid them greatly.

Remarkable! Its truly awesome

Remarkable! Its truly awesome article, I have got much clear idea
about from this piece of writing.

Do you mind if I quote a

Do you mind if I quote a couple of your articles as long as
I provide credit and sources back to your blog? My blog site is in the exact same niche as
yours and my users would definitely benefit from a lot of the information you present here.
Please let me know if this okay with you. Thanks!

And that is an investment

And that is an investment risk price taking.

Hey there! Someone in my

Hey there! Someone in my Facebook group shared this site with us so I came to check it out.
I'm definitely enjoying the information. I'm bookmarking and will
be tweeting this to my followers! Excellent blog and brilliant
style and design.

Hello would you mind letting

Hello would you mind letting me know which web host you're using?
I've loaded your blog in 3 completely different browsers
and I must say this blog loads a lot faster then most.
Can you suggest a good internet hosting provider at a fair price?
Thanks a lot, I appreciate it!

Hozzászólás

A mező tartalma nem nyilvános.
  • Internal paths in double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or relative path.
  • Engedélyezett HTML elemek: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <del> <img>
  • A webcímek és email címek automatikusan linkekké alakulnak.
  • A sorokat és bekezdéseket a rendszer automatikusan felismeri.
  • Engedélyezett HTML elemek: <a> <blockquote> <br> <cite> <code> <dd> <del> <div> <dl> <dt> <em> <li> <ol> <p> <span> <strong> <ul>
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>. The supported tag styles are: <foo>, [foo].
  • Minden email cím át lesz alakítva ember által olvasható módon, vagy (ha a JavaScript engedélyezett) ki lesz cserélve kattintható, de biztonságos hivatkozásra.