English 中文(简体)
Retrieving names of over-ridden theme hooks in views 2 (Drupal 6)
原标题:

I have a created a view (lets call it my_view).

In the theme: information section if the view I have noted one of the suggested template names (views-view--my-view--default.tpl.php (or close to that)), and created my own template file with that name.

This all works fine and when I visit the theme registry, I can see there is a hook there with the name of the template (views-view--my-view--default). However this hook has a type field of engine rather than module . I assume this is to do view the way views works out its own theming?

I want to implement hook_registry_alter to modify this theme hook (and others created in the same way), but I cant work out how to retrieve a list of these hooks.

I tried using array_keys(views_theme()) to get all the views hooks back but this list doesn t contain hooks created by over-riding template files. It only contains the default hooks like views_views_field etc

Is there a way to bring back a list of views theme hooks over-ridden in this way?

问题回答

I answer here as your last comment seems to indicate you are not interested anymore in pursuing your initial approach, and 600 chars would not be enough, anyhow.

An alternative approach to achieve what you want could be to use the "inheritance" of sub-themes from their parent theme. You could in other words define your user theme as a sub-theme of the admin theme.

In this way the theming engine would search for templates - in the case of a user viewing the site through the user theme - first in the user theme folder, then in the admin theme folder, and then in the module directory.

This is for example the same mechanism used by zen for letting you create your themes with the starter kit.

Hope this helps!





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签