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

  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • GeSHi library error: sites/all/modules/geshifilter/geshi is not a directory.
  • 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

Steel Structure Fabrication

1 Bspt Tap

Epe Net Extruder Line

Keep this going please, great

Keep this going please, great job!

Driverless Slim Die-Casting

Bending Machine Parts

Valuable information.

Valuable information. Fortunate me I found your website unintentionally, and I am shocked why this accident
did not took place in advance! I bookmarked it.

Boot Cover Making Machine

Wonderful post however I was

Wonderful post however I was wondering if you could write a litte more on this topic?
I'd be very thankful if you could elaborate a little bit more.
Thank you!

Hey there! This is kind of

Hey there! This is kind of off topic but I need some advice from an established blog.
Is it difficult to set up your own blog? I'm not very techincal but I can figure
things out pretty quick. I'm thinking about making my own but I'm not sure where to begin. Do
you have any ideas or suggestions? Appreciate it

BROKEN BLACK TEA

Cotton Bud

Diamond Vacuum Sealer Bags

Good Hand Cream

Farm Wire Net

Guangzhou Annhao Auto

Aluminium Balance Bike

What a data of un-ambiguity

What a data of un-ambiguity and preserveness of precious experience on the topic of unexpected feelings.

mesh net fabric

Diamond Choker

Ball Joint Suspension

Hello There. I discovered

Hello There. I discovered your blog the use of msn. This is
a really smartly written article. I'll be sure to
bookmark it and come back to learn more of your helpful info.
Thank you for the post. I'll certainly return.

This design is incredible!

This design is incredible! You obviously know how to keep a reader entertained.
Between your wit and your videos, I was almost moved to start my
own blog (well, almost...HaHa!) Wonderful job. I
really enjoyed what you had to say, and more than that, how you presented it.

Too cool!

I was able to find good

I was able to find good advice from your blog articles.

If you wish for to take much

If you wish for to take much from this piece of writing then you
have to apply these strategies to your won website.

Hello exceptional blog! Does

Hello exceptional blog! Does running a blog like this require a large amount of work?
I've absolutely no understanding of programming but I was hoping to start my own blog
in the near future. Anyway, should you have any suggestions or techniques
for new blog owners please share. I know this is off subject nevertheless I just needed to ask.
Cheers!

This is my first time pay a

This is my first time pay a quick visit at here and i am actually pleassant to read
everthing at single place.

Fibc Bag Heat Cutting Machine

Greetings! Very useful advice

Greetings! Very useful advice in this particular post! It's the little changes that produce the most significant changes.
Thanks a lot for sharing!

I always used to read article

I always used to read article in news papers but now as I am a user of internet
thus from now I am using net for articles, thanks to web.

China LED Spot Light

Courts For Sports

Electrical Heating

Disposable Face Mask Chemist

replica louis vuitton speedy

I love what you guys tend to

I love what you guys tend to be up too. This sort of clever work and coverage! Keep up the excellent works guys I've incorporated you guys to blogroll.|

I enjoy reading an article

I enjoy reading an article that can make people think. Also, thanks for permitting me to comment!|

I have read a few good stuff

I have read a few good stuff here. Definitely price bookmarking for
revisiting. I wonder how a lot attempt you
put to create such a fantastic informative site.

Very nice post. I certainly

Very nice post. I certainly appreciate this site. Thanks!|

Greetings! Very useful advice

Greetings! Very useful advice within this article! It is the little changes that produce the biggest changes. Thanks a lot for sharing!|

I really like your blog..

I really like your blog.. very nice colors & theme. Did you design this website yourself or did you hire someone to do it for you? Plz reply as I'm looking to create my own blog and would like to know where u got this from. kudos|

Remarkable issues here. I'm

Remarkable issues here. I'm very glad to look your post. Thanks so much and I am taking a look forward to touch you. Will you please drop me a e-mail?|

Greetings, There's no doubt

Greetings, There's no doubt that your website could be having browser
compatibility problems. Whenever I look at your web site in Safari, it looks fine however, if
opening in Internet Explorer, it has some overlapping issues.

I merely wanted to provide you with a quick heads up! Apart
from that, fantastic site!

each time i used to read

each time i used to read smaller posts which as well clear
their motive, and that is also happening with this article which
I am reading at this place.

}

}

When I originally commented I

When I originally commented I clicked the "Notify me when new comments are added" checkbox and now each time a comment is added I get several e-mails with the same comment. Is there any way you can remove me from that service? Thanks!|

You could definitely see your

You could definitely see your expertise within the work you write.
The arena hopes for more passionate writers such
as you who aren't afraid to mention how they believe.
All the time go after your heart.

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.