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

Nice website you possess

Nice website you possess there.

Awesome post.

Awesome post.

Financial advisors business

Financial advisors business is folks enterprise.

Neat Web site, Continue the

Neat Web site, Continue the beneficial job. Thanks a ton.|

I like the helpful info you

I like the helpful info you provide in your articles.
I will bookmark your weblog and check again here frequently.
I am quite certain I will learn lots of new stuff right here!
Best of luck for the next!

Many thanks, this site is

Many thanks, this site is really valuable.

Schwab Intelligent Portfolios

Schwab Intelligent Portfolios invests in Schwab ETFs.

Heya i'm for the first time

Heya i'm for the first time here. I came across this board and I find It
truly useful & it helped me out a lot. I hope to give something back
and aid others like you aided me.

Wow because this is extremely

Wow because this is extremely excellent work! Congrats and keep it up.

Today, I went to the

Today, I went to the beachfront with my kids. I found a sea shell and
gave it to my 4 year old daughter and said "You can hear the ocean if you put this to your ear."
She put the shell to her ear and screamed. There
was a hermit crab inside and it pinched her ear. She never wants
to go back! LoL I know this is entirely off topic but I had to tell
someone!

Wow, beautiful site. Thnx ...

Wow, beautiful site. Thnx ...

Hi this is kind of of off

Hi this is kind of of off topic but I was wanting to
know 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 guidance from someone with
experience. Any help would be greatly appreciated!

Wow, attractive portal. Thnx

Wow, attractive portal. Thnx ...

And that is an funding threat

And that is an funding threat worth taking.

You've made some decent

You've made some decent points there. I checked on the internet for more info about the
issue and found most people will go along with
your views on this site.

It is really a great and

It is really a great and helpful piece of info. I'm glad that you simply shared this useful information with us.

Please keep us informed like this. Thanks for sharing.

Thank you so much for sharing

Thank you so much for sharing this fantastic web page.

If you wish for to take a

If you wish for to take a great deal from this piece of writing then you have to apply
such methods to your won web site.

Passion the website--

Passion the website-- extremely user pleasant and whole lots to see!

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 four emails with the same comment. Is there any way
you can remove me from that service? Thank you!

Investors do pay direct and

Investors do pay direct and indirect costs.

You're a very beneficial

You're a very beneficial internet site; could not make it without ya!

Greate pieces. Keep posting

Greate pieces. Keep posting such kind of information on your page.

Im really impressed by it.
Hello there, You've done an incredible job. I'll certainly digg it and individually recommend to my friends.
I'm confident they will be benefited from this website.

Wow, lovely site. Thnx ...

Wow, lovely site. Thnx ...

Thanks for your curiosity in

Thanks for your curiosity in Funding Advice.

Very shortly this site will

Very shortly this site will be famous amid all blogging and site-building
people, due to it's good posts

Wow because this is really

Wow because this is really helpful job! Congrats and keep it up.

My partner and I stumbled

My partner and I stumbled over here by a different web page and thought
I might as well check things out. I like what I see so now
i am following you. Look forward to checking out your web page repeatedly.

Appreciate it! It is

Appreciate it! It is definitely an amazing web-site.

I am really grateful to the

I am really grateful to the holder of this website who
has shared this fantastic paragraph at here.

Wow, attractive site. Thnx

Wow, attractive site. Thnx ...

That is true for investment

That is true for investment recommendation as effectively.

Wow that was unusual. I just

Wow that was unusual. I just wrote an incredibly long comment but after I clicked submit
my comment didn't appear. Grrrr... well I'm not writing all that over again. Anyway, just wanted
to say great blog!

You have among the finest web

You have among the finest web pages.

Consider investments that

Consider investments that supply speedy annuities.

Thanks for sharing your

Thanks for sharing your thoughts. I really appreciate your efforts and I will be waiting for your next write ups thanks once again.

Excellent page, Carry on the

Excellent page, Carry on the useful work. Thank you!|

What's up to every single

What's up to every single one, it's truly a nice for me to go to see this web page,
it contains precious Information.

Merely desired to mention Now

Merely desired to mention Now i am thrilled I came upon your website!|

I every time spent my half an

I every time spent my half an hour to read this webpage's posts every day along with a cup
of coffee.

Great web site! It looks

Great web site! It looks extremely expert! Sustain the helpful work!

I visited multiple sites

I visited multiple sites except the audio quality for audio songs present at this website is
genuinely marvelous.

I enjoy reading your web

I enjoy reading your web site. Thanks a ton!

You should be a part of a

You should be a part of a contest for one of the greatest blogs on the web.
I am going to highly recommend this web site!

That is true for funding

That is true for funding advice as nicely.

Many thanks extremely

Many thanks extremely helpful. Will share website with my buddies.

Hello There. I found your

Hello There. I found your blog using msn. This is a really well written article.
I will make sure to bookmark it and return to read more of your useful info.
Thanks for the post. I'll certainly return.

Quite revealing looking

Quite revealing looking forwards to coming back again.

I all the time emailed this

I all the time emailed this blog post page to all my friends, since if like to read it afterward my contacts
will too.

Now it's time to pick your

Now it's time to pick your specific investments.

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.