Jump to:
| Project: | Views |
| Version: | 5.x-1.6-beta5 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I needed a way to control a little further whether a menu item (particularly a tab on my case) was displayed or not. For instance I have a node/$arg/emails where I create an email node type list on a contact node. But I want that tab to be available only on the contact's node, not on any other node type.
For that I created a menu acess php code on the menu section of the page section of the view.
Here is the patch with the modifications I made to the view module. I love this module and I hope this feature would make it into the module, please at least let me know what you think.
I modified the form, the saving of the view, the menu generation (I am skipping this item from the $may_cache if code is there) and the eval() of the code on the creation of the menu function
I also had to alter the database:
ALTER TABLE view_view ADD COLUMN `menu_access_php` LONGTEXT DEFAULT NULL AFTER `menu_parent_tab_weight`;| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| views.menu_access.patch | 3.33 KB | Ignored: Check issue status. | None | None |
Comments
#1
I've already rejected a patch like this once.
Try using $arg-node-contract (I think) instead of just $arg. This is a brand new feature for 1.6 and hasn't been well documented yet.
#2
The $arg-node-contract is not working or I am not using it properly. I looked for that string on the code to see if I can figure out how to use it but I couldn't find it, any help?
The patch would let other complex menu access requirements also.
Anyway, I'd like to have my views module untouched so if there is that feature that would let me have a tab on a specific node type, then that would be great to know how to do it.
Thanks,
a.=
#3
I'm sorry, it's $node-TYPE not $arg-node-TYPE
#4
Thanks, and great, that arises another issue with the title not being displayed when browsing the default URL without arguments:
node/$node-contact/emails for instance
Also not breadcrumbs whatsoever as opposed to node/$arg/emails which does create the breadcrumbs.
I think something's wrong with the title besides this, sorry to mention it here, probably worth posting another issue but as read on the documentation, when browsing an url without an actual argument the page title should display the page title of the view, but if I set a title for the argument with a replacement, I am getting the title with the %1 without any substitution.
Sorry about posting that other issue here, but as this issue has also a different behavior for the title, worth mentioning.
Thanks again, happy to roll back my previous patch,
a.=
#5
Worth to know! Posted as complement to the views documentation bookpage: Views 1.x user documentation > * Page Views
#6
Automatically closed -- issue fixed for two weeks with no activity.
#7
subscribing