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

I wanted to thank you for

I wanted to thank you for this excellent read!!
I certainly enjoyed every bit of it. I have got you saved as a favorite to check out new stuff
you post…

Buyers do pay direct and

Buyers do pay direct and oblique prices.

Take into account investments

Take into account investments that supply instant annuities.

And that is an investment

And that is an investment threat worth taking.

Now it is time to choose your

Now it is time to choose your particular investments.

Hi there! This is my 1st

Hi there! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through your articles.

Can you recommend any other blogs/websites/forums that go over the same subjects?
Thanks a lot!

Thank you to your curiosity

Thank you to your curiosity in Investment Advice.

Somebody essentially lend a

Somebody essentially lend a hand to make severely posts I
would state. That is the first time I frequented your web page and so far?
I amazed with the research you made to make this actual publish incredible.
Excellent job!

Schwab Clever Portfolios

Schwab Clever Portfolios invests in Schwab ETFs.

I blog quite often and I

I blog quite often and I genuinely thank you for your information. Your article has truly peaked
my interest. I am going to take a note of your website and keep checking for new information about once
a week. I subscribed to your RSS feed too.

Traders do pay direct and

Traders do pay direct and oblique prices.

Schwab Intelligent Portfolios

Schwab Intelligent Portfolios invests in Schwab ETFs.

And this is an funding danger

And this is an funding danger worth taking.

For the reason that the admin

For the reason that the admin of this website is working, no uncertainty very soon it will be renowned,
due to its quality contents.

It's an awesome article in

It's an awesome article in support of all the
internet users; they will obtain benefit from it I am sure.

All sorts of investments come

All sorts of investments come with certain risks.

All sorts of investments

All sorts of investments include certain dangers.

My coder is trying to

My coder is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the costs.
But he's tryiong none the less. I've been using Movable-type on various websites for about a year and am worried
about switching to another platform. I have heard excellent things
about blogengine.net. Is there a way I can import all my wordpress posts
into it? Any help would be really appreciated!

Schwab Intelligent Portfolios

Schwab Intelligent Portfolios invests in Schwab ETFs.

Incredible! This blog looks

Incredible! This blog looks exactly like my old one!
It's on a entirely different topic but it has pretty
much the same page layout and design. Outstanding choice of colors!

If some one needs expert view

If some one needs expert view concerning blogging and site-building
after that i advise him/her to go to see this web site, Keep up the fastidious work.

Investors do pay direct and

Investors do pay direct and indirect costs.

Schwab Intelligent Portfolios

Schwab Intelligent Portfolios invests in Schwab ETFs.

This is true for investment

This is true for investment advice as nicely.

Hello there! This post could

Hello there! This post could not be written much better!
Looking at this post reminds me of my previous roommate!
He always kept talking about this. I am going to send this post to
him. Pretty sure he's going to have a good read. I appreciate you for sharing!

I always emailed this website

I always emailed this website post page to all
my contacts, since if like to read it then my friends will too.

Investors do pay direct and

Investors do pay direct and indirect prices.

Do you mind if I quote a few

Do you mind if I quote a few of your articles as long as I provide
credit and sources back to your site? My website is in the very same niche
as yours and my visitors would certainly benefit from some of the information you present here.
Please let me know if this ok with you. Cheers!

Now it's time to decide your

Now it's time to decide your specific investments.

A monetary advisor is your

A monetary advisor is your planning associate.

I am extremely inspired along

I am extremely inspired along with your writing abilities and also with the layout for your weblog.
Is this a paid subject matter or did you modify it your self?
Anyway keep up the nice high quality writing, it's uncommon to peer a great blog like this one today..

All varieties of investments

All varieties of investments come with certain dangers.

You really make it seem

You really make it seem really easy with your presentation but I find this topic to be really something which I believe
I might never understand. It kind of feels too
complex and very vast for me. I'm taking a look forward to your
next post, I will try to get the hold of it!

Thank you on your interest in

Thank you on your interest in Investment Recommendation.

Its such as you read my mind!

Its such as you read my mind! You appear to know a lot about this, such as you wrote the e book
in it or something. I think that you just can do with a
few % to pressure the message home a bit, but other than that, this is fantastic blog.
A fantastic read. I'll definitely be back.

Take into account investments

Take into account investments that provide speedy annuities.

If some one wants expert view

If some one wants expert view regarding blogging and site-building then i recommend
him/her to pay a visit this web site, Keep up the fastidious job.

And that is an funding danger

And that is an funding danger worth taking.

All varieties of investments

All varieties of investments come with certain risks.

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 fundamental and everything. However
imagine if you added some great images or videos to give your posts more, "pop"!
Your content is excellent but with images and videos, this site could undeniably be one of the very best in its field.
Good blog!

Financial advisors business

Financial advisors business is people enterprise.

Right now it appears like

Right now it appears like Wordpress is the preferred blogging platform out there right now.

(from what I've read) Is that what you are using on your blog?

Hi there, I do believe your

Hi there, I do believe your website could be having web browser compatibility problems.
Whenever I look at your website in Safari, it looks fine however, if opening in I.E., it's
got some overlapping issues. I simply wanted to give you a quick heads
up! Aside from that, fantastic blog!

What's up, I log on to your

What's up, I log on to your new stuff like every week.

Your humoristic style is awesome, keep it up!

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 grateful if you could elaborate a little bit more.
Appreciate it!

A monetary advisor is your

A monetary advisor is your planning accomplice.

I have been browsing online

I have been browsing online more than 2 hours today, yet
I never found any interesting article like yours.
It is pretty worth enough for me. Personally, if all site owners and bloggers made good content as you did, the web
will be much more useful than ever before.

I like the valuable info you

I like the valuable info you provide for your articles.
I will bookmark your weblog and take a look at again right here
regularly. I am rather sure I will learn lots of new stuff right right here!
Best of luck for the next!

After checking out a handful

After checking out a handful of the blog articles on your web page,
I truly appreciate your technique of writing a blog. I added
it to my bookmark website list and will be checking back soon. Take a look at my website as well
and let me know your opinion.

Thank you for your curiosity

Thank you for your curiosity in Investment Advice.

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.