The Drupal 6 menu system: architecture, do, don't and tricks (part 1) Peter Wolanin August 27, 2008 Drupalcon, Szeged.

Slides:



Advertisements
Similar presentations
Drupal Basics Part 3 Create a new page Main tabs menu Using the theme Agricultural Communications Services Integrated Media Training Sessions
Advertisements

SharePoint Forms All you ever wanted to know about forms but were afraid to ask.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
WORKING SMART Crystal M. Thomas Henrico County DSS (804) POSSESS Central Region Member October 31, 2007.
CMSC 414 Computer (and Network) Security Lecture 13 Jonathan Katz.
Comprehensive Continuous Improvement Plan(CCIP) Training Module 3 Planning Tool, Part 2.
Drupal Presentation - Menus CS 275 – Intro to Databases Fahmy Mohammed Spencer Forell Max Mueller.
Drupal Blocks David Manela, Mark Ritzman, Chad Campbell.
XHTML1 Tables and Lists. XHTML2 Objectives In this chapter, you will: Create basic tables Structure tables Format tables Create lists.
High Performance Faceted Interfaces Using S2S Eric Rozell, Tetherless World Constellation.
A02 Creating my website NAME ______________. UNIT 2 – A02 – Creating my Website The purpose of this assessment objective is to create 5 web pages containing.
DB Audit Expert v1.1 for Oracle Copyright © SoftTree Technologies, Inc. This presentation is for DB Audit Expert for Oracle version 1.1 which.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
ADVANCED MICROSOFT POWERPOINT Lesson 6 – Creating Tables and Charts
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
8 Copyright © 2004, Oracle. All rights reserved. Creating LOVs and Editors.
1/30/11 Hacking your way through the Drupal API, a themers intro Baris Wanschers (BarisW)
How to extend and configure Drupal without user interaction or database dump By Damien Snoeck for Switzerland Romandy Drupal Group January 27, 2010 Work.
User Group Meeting 5 th March 2008 Presentation by Gary Armstrong & Vicki Hook.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 4 – Creating New.
CPSC 203 Introduction to Computers T59 & T64 By Jie (Jeff) Gao.
Forms - An Overview of Oracle Form Builder v.6.0 Abhishek Parag Prashant Arun.
Creating a Web Site to Gather Data and Conduct Research.
© 2004 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice SISP Training Documentation Template.
E-Commerce: Introduction to Web Development 1 Dr. Lawrence West, Management Dept., University of Central Florida Topics What is a Web.
Tutorial 121 Creating a New Web Forms Page You will find that creating Web Forms is similar to creating traditional Windows applications in Visual Basic.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Management Information Systems MS Access MS Access is an application software that facilitates us to create Database Management Systems (DBMS)
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
Access 2013 Microsoft Access 2013 is a database application that is ideal for gathering and understanding data that’s been collected on just about anything.
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
Key Applications Module Lesson 21 — Access Essentials
 Whether using paper forms or forms on the web, forms are used for gathering information. User enter information into designated areas, or fields. Forms.
Access Manual 2 By Dhawala Kovuri Elham S.Khorasani Ismail Guneydas.
Week 11 Creating Framed Layouts Objectives Understand the benefits and drawbacks of frames Understand and use frame syntax Customize frame characteristics.
State of Kansas Travel Authorizations Statewide Management, Accounting and Reporting Tool Entering a Travel Authorization Navigation: Employee Self Service.
MS Access 2007 Management Information Systems 1. Overview 2  What is MS Access?  Access Terminology  Access Window  Database Window  Create New Database.
Introduction to Programming the WWW I CMSC Winter 2003 Lecture 6.
Chapter 5 Quick Links Slide 2 Performance Objectives Understanding Framesets and Frames Creating Framesets and Frames Selecting Framesets and Frames Using.
Damian Tamayo Tutorial DTM Data Generator Fall 2008 CIS 764.
SESSION 3.1 This section covers using the query window in design view to create a query and sorting & filtering data while in a datasheet view. Microsoft.
How does Drupal Work? Information Systems 337 Prof. Harry Plantinga.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Office Access 2003 Lab 2 Modifying a Table and Creating.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Introduction to Views Stanford Drupal Camp April 6, 2013.
Table of Contents TopicSlide Administrator Login 2 Administrator Navigations 3 Managing AlternativeDr.com Blogs 4 Managing Dr. Lloyd May Blogs 5 Managing.
CE Operating Systems Lecture 17 File systems – interface and implementation.
Lab 6 (2) Arrays ► Lab 5 (1) Exercise Review ► Array Concept ► Why Arrays? ► Array Declaration ► An Example of Array ► Exercise.
LANDESK SOFTWARE CONFIDENTIAL Tips and Tricks with Filters Jenny Lardh.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Session 1 Module 1: Introduction to Data Integrity
Word Create a basic TOC. Course contents Overview: table of contents basics Lesson 1: About tables of contents Lesson 2: Format your table of contents.
CPSC 203 Introduction to Computers T97 By Jie (Jeff) Gao.
Hyperion Artifact Life Cycle Management Agenda  Overview  Demo  Tips & Tricks  Takeaways  Queries.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
24 Copyright © 2009, Oracle. All rights reserved. Building Views and Charts in Requests.
© Execview Ltd 2015: all rights reserved Execview Scorecard Training/Reference Guide 2013 Key functions guide for Scorecard administrators.
World of Wokcraft The very best in Single pan cooking themed fantasy gaming!
June 17, 2009 Office 2007 Tips & Tricks.
T3/Tutorials: Data Submission
Forms Concepts Triggers Fired when Internal/External events occur
Working in the Forms Developer Environment
MVC Architecture. Routing
Creating LOVs and Editors
Data Visualizer.
Joomla Charles Kann.
Quickr Places & Templates Introduction
Aleph Beginning Circulation
A02 Creating my website NAME ______________.
Presentation transcript:

The Drupal 6 menu system: architecture, do, don't and tricks (part 1) Peter Wolanin August 27, 2008 Drupalcon, Szeged

Goals of the 6.x Menu System Separation of page serving and link rendering. Reduced footprint: –interpret dynamic paths without calling hook_menu. –Don’t have all the available callbacks in memory. Scalability of link storage and rendering - how can we handle a site with 10,000 links.

Two independent data tables {menu_router} –Define page callbacks (including local tasks) –May have a fully defined path, or one or more wildcards (%). {menu_links} –Every link has a corresponding router entry (except external links). –The router entry’s access callback determines whether the link is visible.

{menu_router} == hook_menu Each item returned by a hook_menu implementation become a row in the table. It defines the valid paths. Defines how access is permitted to paths. Defines which function is used to render a page at a path. Defines the default title for the page.

{menu_links}: module-created Deleting everything in {menu_links} would not affect page serving. For convenience and to provide a navigation menu, most {menu_router} entries have a system-module-created link. You should not add an item to your hook_menu() just to get a link. Modules that want to add links should do so using menu_link_save() (or use menu_link_maintain() to create/update).

Creating a link is easy Drupal will generate most of the elements of a menu link for you. The only mandatory keys are link_path and link_title. If you want to be able to configure it later in the menu module UI, don’t define ‘module’ and use a menu name from {menu_custom} No access checks for “external” links (e.g. the link path starts with

{menu_links}: encodes hierarchy For Druapl 6, there is a hard-coded limit of 9 levels of depth. We store the materialized path for each link as a series of columns, as well as the depth

Brief anatomy of hook_menu

Little used elements: ‘block callback’, ‘position’ - see function system_main_admin_page() ‘tab_parent’ and ‘tab_root’ can allow you to let a local task appear on a page regardless of path (use with caution). ‘menu_name’ is not used in the router, but is used by system module when saving a link for this router item (caution: core bug).

The new (“secret”) hooks hook_menu_alter() - this lets you alter any property of a router item declared by a module’s hook_menu(). hook_translated_menu_link_alter() - in this case “translated” is distinct from “localized”. This hook is double secret (find out why later). hook_menu_link_alter() - lets you alter a link as it is saved.

Example: hook_menu_alter() CCK is using this hook to changing the page callback for the node-type overview page. Note: filepath - the default filepath is that of the node module (which declared this router item).

Continued: hook_menu_alter() Views uses this to add router items that may replace ones declared by other modules, depending on the specified View path. In general, it may be easier to alter individual elements, rather than replacing an item, since you need to be sure to fill in all the keys, including the ‘module’ key the specifies which module created the item (used for finding an include file).

hook_translated_menu_link_alter() This hook is called after a link has been processed to check whether the user has access, including possibly loading objects based on the path before the link in rendered. However, since few links are altered, for performance this hook is only called on a link if the “alter” element of the link’s options is not empty (e.g. TRUE).

hook_menu_link_alter() This hook can be used in combination with hook_translated_menu_link_alter().

Two more possible gotchas: The ‘localized_options’ are used for rendering a menu link. If the link’s ‘access’ is not TRUE, the link will not have been localized.

See the Drupal handbooks: Drupal menu system (Drupal 6.x) New hooks: hook_menu_alter() and hook_menu_link_alter() When and how to use menu_links