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

A111G49PRS New Jewellery Ring

Fendi財布コピー Basin Faucet

is cialis generic

is cialis generic http://cicilisp.com/ vitality ed pills Psprsq uioopg

cialis women

cialis women http://ciardos.com/ cure ed Drhnio qbwtjg

384250-5005 Bamboo Bristles

sildenafil generic name

sildenafil generic name http://shpilipills.com/ home remedies for erectile dysfunction Pulwmk hfzzwl

101873RSP27BR 3m Disposable

178588-3002 100 Percent

cvs pharmacy

cvs pharmacy http://pharmedplls.com/ ed solutions Ilvhub prtzwa

ブライトリングETA7750搭載 Industrial

IW371445 Cash Safe Security

China Column Pillar セイコー偽物

グッチバッグスーパーコピー Air Filter

buy tadalafil online reddit

buy tadalafil online reddit http://taedfil.com/ mens ed pills Vqpmyw btirzb

tadalafil 10mg

tadalafil 10mg http://tadstrong.com/ best over the counter ed pills Dljksu kqmzab

It is in point of fact a

It is in point of fact a great and useful piece of information. I'm happy that you shared this helpful info with us. Please stay us informed like this. Thanks for sharing.|

Heya this is kinda of off

Heya this is kinda of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML. I'm starting a blog soon but have no coding expertise so I wanted to get advice from someone with experience. Any help would be enormously appreciated!|

Valuable information.

Valuable information. Fortunate me I found your website unintentionally, and I'm stunned why this twist of fate did not happened in advance! I bookmarked it.|

Asking questions are actually

Asking questions are actually good thing if you are not understanding anything completely, however this post provides nice understanding yet.|

I think the admin of this

I think the admin of this website is in fact working hard in support of his website, for the reason that here every data is quality based data.|

Very descriptive post, I

Very descriptive post, I liked that bit. Will there be a part 2?|

Way cool! Some extremely

Way cool! Some extremely valid points! I appreciate you writing this post plus the rest of the website is extremely good.|

Your style is really unique

Your style is really unique compared to other people I've read stuff from. Thanks for posting when you have the opportunity, Guess I will just book mark this blog.|

Hey! I know this is somewhat

Hey! I know this is somewhat off topic but I was wondering if you knew where I could locate a captcha plugin for my comment form? I'm using the same blog platform as yours and I'm having trouble finding one? Thanks a lot!|

If you are going for most

If you are going for most excellent contents like me, just pay a visit this web page daily because it presents feature contents, thanks|

Hi, after reading this

Hi, after reading this remarkable post i am too cheerful to share my knowledge here with friends.|

Generally I don't read

Generally I don't read article on blogs, but I wish to say that this write-up very forced me to check out and do it! Your writing taste has been surprised me. Thanks, very great post.|

Nice weblog right here! Also

Nice weblog right here! Also your web site a lot up fast! What host are you the use of? Can I get your affiliate link for your host? I desire my website loaded up as fast as yours lol|

Thanks for another excellent

Thanks for another excellent post. Where else could anybody get that kind of info in such a perfect way of writing? I've a presentation next week, and I am at the look for such info.|

Hi there, its pleasant piece

Hi there, its pleasant piece of writing about media print, we all be familiar with media is a great source of facts.|

This is very interesting,

This is very interesting, You're a very skilled blogger. I've joined your feed and look forward to seeking more of your excellent post. Also, I have shared your web site in my social networks!|

Hi there, I discovered your

Hi there, I discovered your web site by way of Google at the same time as searching for a related matter, your website came up, it appears good. I have bookmarked it in my google bookmarks.

Greetings! Very helpful

Greetings! Very helpful advice in this particular article! It's the little changes that make the biggest changes. Many thanks for sharing!|

May I just say what a relief

May I just say what a relief to discover somebody who genuinely understands what they're discussing on the net. You actually know how to bring an issue to light and make it important. A lot more people ought to check this out and understand this side of the story. I was surprised you aren't more popular since you surely have the gift.|

It's truly very difficult in

It's truly very difficult in this full of activity life to listen news on Television, so I only use world wide web for that purpose, and take the most recent news.|

You ought to be a part of a

You ought to be a part of a contest for one of the highest quality websites on the internet. I most certainly will recommend this website!|

Way cool! Some very valid

Way cool! Some very valid points! I appreciate you writing this write-up and the rest of the site is really good.|

sildenafil reviews

sildenafil reviews http://sildenafig.com/ erection pills that work Xwpcuq pcemqn

I savor, result in I found

I savor, result in I found exactly what I used to be taking a look for. You have ended my four day lengthy hunt! God Bless you man. Have a nice day. Bye|

wonderful submit, very

wonderful submit, very informative. I wonder why the opposite specialists of this sector do not notice this. You should continue your writing. I'm sure, you have a huge readers' base already!|

Thanks to my father who

Thanks to my father who informed me about this webpage, this weblog is in fact remarkable.|

I got this website from my

I got this website from my buddy who informed me
regarding this web site and now this time I am browsing this site
and reading very informative posts at this time.

We're a group of volunteers

We're a group of volunteers and starting a new scheme in our community. Your website provided us with valuable info to work on. You have done a formidable job and our whole community will be thankful to you.|

I think this is among the

I think this is among the most important info for me. And i'm glad reading your article. But should remark on few general things, The website style is wonderful, the articles is really great : D. Good job, cheers|

Helpful info. Lucky me I

Helpful info. Lucky me I discovered your site by chance, and
I'm shocked why this twist of fate didn't took place in advance!
I bookmarked it.

Heya i'm for the first time

Heya i'm for the first time here. I came across this board and I to find It really useful & it helped me out a lot. I hope to present something again and help others like you helped me.|

What a information of

What a information of un-ambiguity and preserveness of precious know-how about unexpected emotions.|

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.