[development] Interacting with Views Tabs via code

larry at garfieldtech.com larry at garfieldtech.com
Mon Mar 29 18:34:05 UTC 2010


Views does all of its menu manipulation in hook_menu_alter already, so 
if your hook_menu_alter runs first then the views additions won't be 
there.  Try setting your module weight to heavier than views.

Alternatively, create your page first using hook_menu as the default tab 
and then tweak the view to just add tabs to the page you already 
created.  That may be the cleaner approach.

--Larry Garfield

On 3/29/10 10:58 AM, Sam Tresler wrote:
> Hello,
>
> Not sure if this is the best place, but I've come across an interesting
> problem and I'm not certain how to proceed. I have a 3 tabbed view (you
> can actually see the live version here:
> http://livestrongaction.org/featured_dedications). I want to add a 4th
> tab, and thought this would be simply adding a custom module with
> hook_menu and a MENU_LOCAL_TASK. However, it appears that views is doing
> something that prevents hook_menu from interacting there. I next thought
> I would try hook_menu_alter, but I can't see the three tabs being
> rendered in the &$items array passed into that hook.
>
> Now, I could just intercept this at the theme level and add what I
> needed, but that seems kludgy. I'm tempted to move the entire view into
> code, but not sure how that would necessarily help this situtation. I
> may ask on IRC< or the views support queue, but thought this list may be
> able to give me a few leads.
>
> Any idea how to get a menu tab to render on a tabbed view? Hope I'm not
> missing something obvious. Thanks in advance.
>
> -Sam Tresler
>
>


More information about the development mailing list