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

Do you have any video of

Do you have any video of that? I'd like to find out some additional information.

Hi there, after reading this

Hi there, after reading this awesome article i am also
glad to share my familiarity here with friends.

Financial advisors enterprise

Financial advisors enterprise is people enterprise.

I get pleasure from, result

I get pleasure from, result in I found exactly what I used to be looking
for. You have ended my four day long hunt! God Bless you
man. Have a nice day. Bye

This is true for funding

This is true for funding advice as well.

Financial advisors business

Financial advisors business is individuals enterprise.

Hey there, I think your

Hey there, I think your website might be having browser compatibility
issues. When I look at your blog site in Firefox, it looks fine but when opening in Internet
Explorer, it has some overlapping. I just wanted
to give you a quick heads up! Other then that, wonderful
blog!

I'm gone to say to my little

I'm gone to say to my little brother, that he should also visit this website on regular basis to obtain updated from newest gossip.

Thank you to your curiosity

Thank you to your curiosity in Investment Recommendation.

Think about investments that

Think about investments that provide immediate annuities.

And this is an investment

And this is an investment threat worth taking.

Schwab Clever Portfolios

Schwab Clever Portfolios invests in Schwab ETFs.

Appreciate the

Appreciate the recommendation. Let me try it out.

What i don't understood is in

What i don't understood is in reality how you're no longer really a lot
more neatly-liked than you might be now. You're very intelligent.
You recognize therefore significantly in relation to this
matter, produced me in my opinion believe it from numerous varied angles.
Its like women and men don't seem to be interested
until it is one thing to do with Woman gaga! Your individual stuffs great.
All the time maintain it up!

Now it is time to pick your

Now it is time to pick your specific investments.

Investors do pay direct and

Investors do pay direct and indirect prices.

Contemplate investments that

Contemplate investments that provide fast annuities.

Monetary advisors enterprise

Monetary advisors enterprise is folks enterprise.

Investors do pay direct and

Investors do pay direct and oblique costs.

Hello, all is going perfectly

Hello, all is going perfectly here and ofcourse every one is sharing
information, that's genuinely good, keep up writing.

Now it's time to pick your

Now it's time to pick your particular investments.

I would like to thank you for

I would like to thank you for the efforts you've put in writing this site.
I'm hoping to check out the same high-grade blog posts
by you later on as well. In fact, your creative writing abilities has encouraged me to get my own, personal blog now ;)

This is true for funding

This is true for funding recommendation as properly.

Hi, this weekend is good in

Hi, this weekend is good in favor of me,
as this time i am reading this great informative post here at my home.

Thank you in your interest in

Thank you in your interest in Investment Recommendation.

After exploring a few of the

After exploring a few of the blog articles on your blog, I
really like your technique of writing a blog. I added it to my bookmark webpage list and will be
checking back soon. Please check out my website as well and tell me what you think.

And that is an funding danger

And that is an funding danger worth taking.

All sorts of investments come

All sorts of investments come with sure dangers.

Greetings! Very helpful

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

If you want to get a great

If you want to get a great deal from this post then you have to apply these techniques to your won web site.

Schwab Intelligent Portfolios

Schwab Intelligent Portfolios invests in Schwab ETFs.

Hey very interesting blog!

Hey very interesting blog!

Contemplate investments that

Contemplate investments that offer rapid annuities.

Howdy! I know this is kinda

Howdy! I know this is kinda off topic however I'd figured
I'd ask. Would you be interested in exchanging links or
maybe guest writing a blog post or vice-versa?

My blog discusses a lot of the same topics as yours and I feel we could greatly
benefit from each other. If you're interested feel free to shoot me an e-mail.
I look forward to hearing from you! Wonderful blog
by the way!

Now it is time to pick your

Now it is time to pick your specific investments.

Thank you for your interest

Thank you for your interest in Investment Advice.

fantastic issues altogether,

fantastic issues altogether, you just received a new reader.
What would you suggest in regards to your post that
you just made some days in the past? Any positive?

Good article! We are linking

Good article! We are linking to this particularly great article on our site.

Keep up the good writing.

Take into account investments

Take into account investments that supply fast annuities.

I’m not that much of a

I’m not that much of a internet reader to be honest but your blogs really nice, keep it up!
I'll go ahead and bookmark your site to come back in the future.
Many thanks

Wonderful beat ! I wish to

Wonderful beat ! I wish to apprentice while you
amend your web site, how can i subscribe for a blog web site?
The account aided me a acceptable deal. I had been tiny bit acquainted of this your
broadcast offered bright clear concept

Remarkable issues here. I am

Remarkable issues here. I am very happy to look your article.
Thank you a lot and I am having a look ahead to touch you.
Will you please drop me a mail?

I do consider all of the

I do consider all of the concepts you've presented
to your post. They are very convincing and will definitely
work. Still, the posts are too quick for beginners.
May just you please lengthen them a little from next time?
Thanks for the post.

That is a really good tip

That is a really good tip especially to those new to the blogosphere.

Simple but very precise info… Thanks for sharing this one.
A must read post!

This is true for investment

This is true for investment recommendation as well.

I am really impressed with

I am really impressed with your writing skills as well as with the layout on your weblog.
Is this a paid theme or did you modify it yourself?
Either way keep up the nice quality writing, it
is rare to see a great blog like this one nowadays.

Excellent goods from you,

Excellent goods from you, man. I've consider your stuff
previous to and you are simply extremely great. I really like what you've obtained here,
really like what you're saying and the way in which you assert it.
You are making it entertaining and you still take care of to stay it wise.
I can not wait to learn much more from you. That is really
a wonderful site.

A financial advisor is your

A financial advisor is your planning partner.

Take into account investments

Take into account investments that offer instant annuities.

If you want to grow your

If you want to grow your familiarity simply keep visiting this
website and be updated with the newest news update posted
here.

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.