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.
  • 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

This information is

This information is priceless. Where can I find out more?

I read this paragraph fully

I read this paragraph fully about the resemblance of newest and preceding technologies, it's awesome article.

Central Air Unit

You actually make it seem so

You actually make it seem so easy with your presentation but I find this topic to be really something that I think I would never understand.
It seems too complex and very broad for me. I am looking forward for your next post, I'll
try to get the hang of it!

Everything is very open with

Everything is very open with a precise description of the issues.
It was definitely informative. Your site is very useful.
Many thanks for sharing!

I am regular reader, how are

I am regular reader, how are you everybody? This paragraph posted at this web page is actually fastidious.

What i do not realize is

What i do not realize is actually how you are now not really
much more well-appreciated than you might be right now.
You are so intelligent. You understand therefore considerably when it comes to this
topic, produced me individually imagine it from a lot of numerous angles.
Its like women and men aren't interested except it's one thing to accomplish with Girl gaga!
Your own stuffs outstanding. All the time deal with it up!

Unquestionably believe that

Unquestionably believe that which you said. Your
favorite justification appeared to be on the net the simplest thing to be aware of.
I say to you, I certainly get annoyed while people consider worries that they just don't know about.
You managed to hit the nail upon the top and also defined out
the whole thing without having side effect , people could take a signal.
Will likely be back to get more. Thanks

Hi there terrific blog! Does

Hi there terrific blog! Does running a blog similar to this
require a massive amount work? I've very little understanding
of programming however I was hoping to start my
own blog in the near future. Anyhow, should you have any
ideas or techniques for new blog owners please share. I know this is off topic but I simply had to ask.

Cheers!

Good post. I certainly love

Good post. I certainly love this website. Keep it up!

Just desire to say your

Just desire to say your article is as surprising.
The clearness in your post is simply nice and i could assume you are an expert on this subject.

Fine with your permission allow me to grab your feed to keep updated with forthcoming post.
Thanks a million and please keep up the rewarding work.

I know this if off topic but

I know this if off topic but I'm looking into starting my own blog and was wondering what all is required to get setup?
I'm assuming having a blog like yours would cost a pretty penny?
I'm not very web smart so I'm not 100% positive. Any recommendations or advice would be greatly appreciated.
Kudos

Its such as you learn my

Its such as you learn my mind! You appear to understand so much
approximately this, such as you wrote the guide in it or something.
I believe that you just could do with a few % to force the message home
a bit, but other than that, this is fantastic blog.

An excellent read. I will certainly be back.

I couldn't resist commenting.

I couldn't resist commenting. Very well written!

Cyproconazole 40% SC

Elevator Automatic

Valuable information. Lucky

Valuable information. Lucky me I found your web site by accident, and I'm shocked why this coincidence did not
took place earlier! I bookmarked it.

African 3 Pin Ac Power Cord

Smooth Bore Hose

Micro Oven Switches

Tungsten Cutter Die

Have you ever thought about

Have you ever thought about adding a little bit
more than just your articles? I mean, what you say is important and
all. However think about if you added some great visuals or videos to give your posts more, "pop"!
Your content is excellent but with images and videos, this blog could definitely be one of the most beneficial in its niche.
Great blog!

Hammer Machine Price

I am regular visitor, how are

I am regular visitor, how are you everybody?
This post posted at this website is genuinely pleasant.

Insulated Backpack Cooler Bag

China Artificial Grass For

Hi to every one, for the

Hi to every one, for the reason that I am really
eager of reading this website's post to be updated on a regular basis.
It includes pleasant stuff.

2 Litre Glass Storage Jars

High-Purity Mica Powder

buying a research paper -

buying a research paper - site essay writers online

Adenovirus Test

pcl /Pdo thread

Mill Cnc

China Pcb Manufacturer

Excellent post however I was

Excellent 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 further.

Bless you!

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.