Aktív menüpont beállítása views által létrehozott oldalakon

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: 
Snippet

Mai néhány órás kínszenvedésem jegyzete, avagy miként állítsunk be aktív menüpontot olyan page típusú nézethez, amit nem fűztünk fel aktív menüútvonalra. Normál esetben ugye, ha csinálunk egy nézetet nezet1 útvonalra, egy másikat nezet1/nezet2 útvonalra, az active-trail szépen végigszalad az útvonalakon.

De mi van akkor, ha argumentumot használunk, netán olyan menüelem kell aktívnak, aminek semmi köze az adott útvonalhoz?

Az én esetemben konkrétan ez volt: Van egy og csoport, aminek vannak fórumtémái. Ezeknek a listáját kellett megjelentetni a csoport node oldalán fülön. Ebben nincsen semmi bonyolult, a page-nek kell node/%/forum útvonal, validálni az argumentumot, 'asztcsókolom.

Naja, de hogy lesz ebből aktív a csoportok útvonalon elhelyezkedő Csoportok főmenüpont az elsődleges linkek között?

Van egy modul, a menutrails, ami hasonlót csinál, ám ott csak tartalomtípusokra lehet ezeket ráhúzni. Elvileg contex-tel is meg lehet csinálni, viszont a menutrails mellett custom_breadcrumbs modul is elég dúvad módon túrja azokat a hookat, amikkel ezeket lehet babrálni, szóval nálam ez sem működött.

Végül szétkaptam a menutrails, és összeszedtem, hogy hogyan is lesz. Annyi a lényeg, hogy kell egy hook, amiben ezt meg tudjuk csinálni. Az én esetemben a hook_views_pre_render(&$view) volt a nyerő, hiszen nézethez kell kapcsolni a duhajkodásunkat.

  1. Kell egy $item = menu_get_item().
  2. Az $item tömbön kell a href értéket módosítani, vagyis $item['href'] = 'menüelem útvonala, amit aktívnak akarsz látni'.
  3. A végén ennyi kell: menu_set_item(NULL, $item);

És voila.

Nézzük az én kódomat, nekem az kellett, hogyha a node/%/tökmindegymi útvonalon vagyunk, akkor bizonyos tartalomtípusok esetében bizonyos menüelem legyen aktív:

[geshifilter-drupal6]/** * Implements hook_views_pre_render(). */ function custom_hooks_views_pre_render(&$view) { if (strstr($view->current_display, 'page')) { if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2)) { $item = menu_get_item(); //itt biza be kell tölteni a node ojjektumot, mert az az ilyen oldalakon nincsen. $node = node_load(arg(1)); switch ($node->type) { case 'group' : $item['href'] = 'csoportok'; menu_set_item(NULL, $item); } } } }[/geshifilter-drupal6]

Edit: Mivel közben nem csak view oldalon kellett használnom a trükköt, megtaláltam a pörfikthúkot, ami nem más, mint a hook_init, ez ugyanis minden oldalgeneráláskor lefut. Ebben nyugodtan lehet játszadozni.

Hozzászólások

Ahaa, its fastidious

Ahaa, its fastidious conversation about this paragraph here at this blog, I have read all that, so at this time me also commenting here.|

I really like your blog..

I really like your blog.. very nice colors
& theme. Did you make this website yourself or did you hire someone to do it for you?
Plz answer back as I'm looking to create my own blog and would like to find out where u got
this from. appreciate it

Great blog! Is your theme

Great blog! Is your theme custom made or did you download it
from somewhere? A design like yours with a few simple adjustements would really make my blog jump
out. Please let me know where you got your theme. Cheers

Nice blog right here!

Nice blog right here! Additionally your web site a lot up very fast! What web host are you using? Can I get your affiliate hyperlink in your host? I want my site loaded up as quickly as yours lol|

Pretty part of content. I

Pretty part of content. I just stumbled upon your weblog and in accession capital to assert that I acquire actually enjoyed account your weblog posts. Anyway I will be subscribing on your feeds and even I fulfillment you access constantly rapidly.|

It's going to be finish of

It's going to be finish of mine day, however before finish I am reading this fantastic paragraph to increase my experience.|

Hello terrific website! Does

Hello terrific website! Does running a blog similar to
this require a lot of work? I have no knowledge of computer programming
but I had been hoping to start my own blog in the
near future. Anyway, if you have any recommendations or tips for new blog owners please share.

I know this is off subject however I simply had to ask.
Appreciate it!

Ridiculous quest there. What

Ridiculous quest there. What happened after? Thanks!|

Have you ever considered

Have you ever considered creating an e-book or guest authoring
on other sites? I have a blog based on the same topics you discuss and would really like to have you share some stories/information.
I know my readers would enjoy your work. If you are even remotely interested, feel free to shoot me an e-mail.

I was recommended this

I was recommended this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my trouble. You are amazing! Thanks!|

Thank you for sharing your

Thank you for sharing your thoughts. I really appreciate your efforts and I will be waiting for your further post thank you once again.|

Hello to every one, the

Hello to every one, the contents present at this site are actually awesome for people knowledge, well, keep up the good work fellows.|

I'm not sure exactly why but

I'm not sure exactly why but this blog is loading incredibly slow for me.
Is anyone else having this problem or is it a problem on my end?
I'll check back later and see if the problem still exists.

Currently it sounds like

Currently it sounds like Expression Engine is the preferred blogging platform out there right now.
(from what I've read) Is that what you're using on your blog?

I'm really loving the

I'm really loving the theme/design of your blog. Do you ever
run into any internet browser compatibility problems?
A couple of my blog audience have complained about
my site not operating correctly in Explorer but looks great in Opera.
Do you have any tips to help fix this issue?

At this time it sounds like

At this time it sounds like Drupal is the top blogging platform available right now. (from what I've read) Is that what you are using on your blog?|

Hello There. I found your

Hello There. I found your blog using msn. This
is an extremely well written article. I will be sure to bookmark it and come back to read more of your useful info.
Thanks for the post. I will definitely comeback.

Nice post. I learn something

Nice post. I learn something totally new and challenging on sites I stumbleupon everyday.
It will always be exciting to read articles from other authors and use a
little something from other sites.

I'm impressed, I have to

I'm impressed, I have to admit. Rarely do I encounter a blog that's both educative and
amusing, and let me tell you, you have hit the nail on the head.
The issue is something not enough people are
speaking intelligently about. Now i'm very happy that I stumbled across this in my hunt for
something concerning this.

I think the admin of this

I think the admin of this website is genuinely working hard for his web page, because here every material is quality based information.|

Excellent site you've got

Excellent site you've got here.. It's difficult to find quality writing like yours nowadays. I truly appreciate people like you! Take care!!|

Pretty nice post. I just

Pretty nice post. I just stumbled upon your
blog and wished to say that I've really enjoyed browsing your blog posts.
In any case I will be subscribing to your rss feed and I hope you write again very soon!

We are a group of volunteers

We are a group of volunteers and starting a new scheme in our community. Your web site provided us with helpful information to work on. You have done an impressive task and our whole neighborhood can be grateful to you.|

It's really a nice and useful

It's really a nice and useful piece of information. I'm happy that you
shared this helpful info with us. Please keep us informed like this.
Thank you for sharing.

Remarkable! Its really

Remarkable! Its really awesome article, I have got much clear idea about from this post.|

It's awesome for me to have a

It's awesome for me to have a web page, which is useful in support of my know-how.
thanks admin

WOW just what I was searching

WOW just what I was searching for. Came here by searching for click here

Icy a fabulous wine bottle

Icy a fabulous wine bottle and a few water will help keep rain water chilled.

Decisions are likely to be

Decisions are likely to be given since the content material at layered plates associated with ramen, just a little That i loved in particular.

What's up, just wanted to

What's up, just wanted to say, I loved this post.
It was helpful. Keep on posting!

Hi all, here every one is

Hi all, here every one is sharing these knowledge, so it's fastidious
to read this blog, and I used to visit this website all the
time.

Thank you a bunch for sharing

Thank you a bunch for sharing this with all of us you really understand what you're talking about!

Bookmarked. Please also discuss with my site =).
We could have a link alternate agreement among us

Exceptional post but I was

Exceptional post but I was wondering if you could write a litte more on this subject? I'd be very thankful if you could elaborate a little bit more. Thank you!|

I loved as much as you'll

I loved as much as you'll receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get bought an impatience over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this increase.|

Certainly no Sizzling

Certainly no Sizzling Beginnings.

Thank you a bunch for sharing

Thank you a bunch for sharing this with all folks you actually recognize what you are talking approximately!
Bookmarked. Please also discuss with my web site =).
We will have a link alternate contract between us

Have you ever thought about

Have you ever thought about including a little bit more than just your articles? I mean, what you say is valuable and all. Nevertheless just imagine if you added some great pictures or videos to give your posts more, "pop"! Your content is excellent but with images and videos, this blog could undeniably be one of the best in its field. Awesome blog!|

Your way of describing the

Your way of describing the whole thing in this piece of writing is truly good, all can easily be aware of it,
Thanks a lot.

Thanks for your marvelous

Thanks for your marvelous posting! I quite enjoyed reading it, you can be a great
author. I will ensure that I bookmark your blog and will eventually
come back someday. I want to encourage continue your great
posts, have a nice weekend!

If some one wants expert view

If some one wants expert view about running a blog afterward i recommend him/her to visit this webpage, Keep up the pleasant job.|

For this reason, the person

For this reason, the person worked his the perfect time to the actual gratification with the court system.

After I originally left a

After I originally left a comment I seem to have clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get 4 emails with the exact same comment. There has to be an easy method you can remove me from that service? Cheers!|

Asking questions are

Asking questions are genuinely nice thing if you are not understanding anything totally, however this paragraph presents nice understanding yet.

What's up, I log on to your

What's up, I log on to your blogs on a regular basis.
Your writing style is witty, keep up the good work!

Read lots of usefull tips and

Read lots of usefull tips and trick how to win on online
casino here :

https://www.bbd.casino/info_details/cara-menang-baccarat

https://www.bbd.casino/info_details/how-to-register

https://www.bbd.casino/info_details/how-to-deposit

https://www.bbd.casino/info_details/how-to-withdraw

https://www.bbd.casino/info_details/how-to-play-game

https://www.bbd.casino/info_details/how-to-win-online-casino

https://www.bbd.casino/info_details/best-way-to-play-roulette-online

https://www.bbd.casino/info_details/guaranteed-win-online-casino

https://www.bbd.casino/info_details/how-to-win-918kiss-jackpot

https://www.bbd.casino/info_details/best-game-to-play-at-casino

https://www.bbd.casino/info_details/tricks-to-winning-on-slot-machines

https://www.bbd.casino/info_details/malaysia-online-casino-promotion

https://www.bbd.casino/info_details/slot-game-malaysia

https://www.bbd.casino/info_details/online-slots-malaysia

https://www.bbd.casino/info_details/online-betting-malaysia

https://www.bbd.casino/info_details/trusted-online-casino-malaysia

https://www.bbd.casino/info_details/online-gambling-in-malaysia

https://www.bbd.casino/info_details/genting-casino

https://www.bbd.casino/info_details/online-casino-malaysia

https://www.bbd.casino/info_details/best-slot-machines-to-play-2021

https://www.bbd.casino/info_details/best-casino-games-for-beginners

https://www.bbd.casino/info_details/how-are-slot-machines-made

https://www.bbd.casino/info_details/how-do-slot-machine-work

https://www.bbd.casino/info_details/how-to-play-slot-machine-for-beginners

https://www.bbd.casino/info_details/how-to-play-slot-machine

https://www.bbd.casino/info_details/how-to-tell-if-a-slot-machine-is-rea...

https://www.bbd.casino/info_details/how-to-win-at-roulette

https://www.bbd.casino/info_details/how-to-win-online-casino-games

https://www.bbd.casino/info_details/mobile-slot-malaysia

https://www.bbd.casino/info_details/online-gambling-real-money

https://www.bbd.casino/info_details/real-casino-online-malaysia

https://www.bbd.casino/info_details/slot-machine-payout-schedule

https://www.bbd.casino/info_details/how-to-win-roulette-in-real-casino

https://www.bbd.casino/info_details/how-to-win-slot

https://www.bbd.casino/info_details/mobile-casino-pay-with-phone-credit

https://www.bbd.casino/info_details/online-casino-top-up-by-mobile

https://www.bbd.casino/info_details/tricks-to-winning-on-slot-machines-a...

https://www.bbd.casino/info_details/which-slot-machines-pay-the-best-2021

https://www.bbd.casino/info_details/best-online-betting-sites-malaysia

https://www.bbd.casino/info_details/how-to-read-betting-odds

https://www.bbd.casino/info_details/understanding-betting-lines

https://www.bbd.casino/info_details/how-to-read-horse-racing-program

https://www.bbd.casino/info_details/how-to-read-a-horce-racing-form

https://www.bbd.casino/info_details/how-to-be-good-at-poker

https://www.bbd.casino/info_details/how-to-play-fish-table-online

https://www.bbd.casino/info_details/how-to-play-idn-poker-malaysia

We are a group of volunteers

We are a group of volunteers and starting a new
scheme in our community. Your website offered us with valuable info to work on. You have done an impressive job and our whole community will be grateful to you.

Hello would you mind letting

Hello would you mind letting me know which hosting company you're utilizing? I've loaded your blog in 3 different web browsers and I must say this blog loads a lot quicker then most. Can you suggest a good internet hosting provider at a honest price? Cheers, I appreciate it!|

Someone necessarily assist to

Someone necessarily assist to make severely posts I'd state. That is the very first time I frequented your website page and so far? I amazed with the analysis you made to make this particular submit extraordinary. Magnificent process!|

Very nice post. I just

Very nice post. I just stumbled upon your
weblog and wanted to say that I have truly enjoyed surfing around your blog posts.
After all I'll be subscribing to your rss feed and I hope you
write again soon!

Pretty nice post. I just

Pretty nice post. I just stumbled upon your weblog and wanted to say that I've truly enjoyed browsing your blog posts. After all I will be subscribing to your feed and I hope you write again very soon!|

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.