Hi,
The actual problem is providing an API to let modules add META in a more structured way so that eg. the same META is not sent 2 times or module can decide to concatenate further meta or define a "owerwriteability" level.
I gave a look to nodewords aka Meta tags but I have stuff that aren't nodes (they aren't views or taxonomies either) that don't fit with the node paradigm too well.
nodewords provide a hook to 'prepare' META but it is on a module base. Nodewords needs to be aware of all the content types (or just pages, menu_hook etc...) it can support (*unless I'm missing something...*) but actually what know better which are the most suitable meta for a "content" should be the content producer (be it a "node" or just a MENU_CALLBACK). Other modules like nodewords_bypath and _nodetype do some extrawork to know what actually called the hook. But I'd find myself more comfortable with a different approach: - there is a common API that let me manage META - modules that want to add META use it - when everything is ready drupal_set_html_head get called
The problem is: - the API functions should be ready when other modules call them - drupal_set_html_head($meta) should be called last
If the weight of my meta module is high, other modules won't find the functions. If the weight of my module is low and I put drupal_set_html_head($meta) in the menu hook, drupal_set_html_head will be called before $meta had the chance to be filled by other modules.
I'd say this is a general common problem but I didn't find any "drupalish" way to solve it.
The easiest (and somehow elegant) way I thought to deal with this problem was to build up 2 modules with different weight): - meta_prepare (that will offer the functions) - meta_deliver (that will simply call drupal_set_html_head)
Is there a more drupalish way to deal with dependency and "order of execution" in drupal?
thanks
Hi Ivan,
I just looked over your post really quickly. But that quick glance makes me think you are need of one or both of the following modules in addition to nodewords:
http://drupal.org/project/nodewords_bypath http://drupal.org/project/nodewords_nodetype
best,
Shai content2zero http://content2zero.com
On Fri, Jan 2, 2009 at 9:17 AM, Ivan Sergio Borgonovo mail@webthatworks.itwrote:
Hi,
The actual problem is providing an API to let modules add META in a more structured way so that eg. the same META is not sent 2 times or module can decide to concatenate further meta or define a "owerwriteability" level.
I gave a look to nodewords aka Meta tags but I have stuff that aren't nodes (they aren't views or taxonomies either) that don't fit with the node paradigm too well.
nodewords provide a hook to 'prepare' META but it is on a module base. Nodewords needs to be aware of all the content types (or just pages, menu_hook etc...) it can support (*unless I'm missing something...*) but actually what know better which are the most suitable meta for a "content" should be the content producer (be it a "node" or just a MENU_CALLBACK). Other modules like nodewords_bypath and _nodetype do some extrawork to know what actually called the hook. But I'd find myself more comfortable with a different approach:
- there is a common API that let me manage META
- modules that want to add META use it
- when everything is ready drupal_set_html_head get called
The problem is:
- the API functions should be ready when other modules call them
- drupal_set_html_head($meta) should be called last
If the weight of my meta module is high, other modules won't find the functions. If the weight of my module is low and I put drupal_set_html_head($meta) in the menu hook, drupal_set_html_head will be called before $meta had the chance to be filled by other modules.
I'd say this is a general common problem but I didn't find any "drupalish" way to solve it.
The easiest (and somehow elegant) way I thought to deal with this problem was to build up 2 modules with different weight):
- meta_prepare (that will offer the functions)
- meta_deliver (that will simply call drupal_set_html_head)
Is there a more drupalish way to deal with dependency and "order of execution" in drupal?
thanks
-- Ivan Sergio Borgonovo http://www.webthatworks.it
-- [ Drupal support list | http://lists.drupal.org/ ]
please
--- On Fri, 1/2/09, Shai Gluskin shai@content2zero.com wrote:
From: Shai Gluskin shai@content2zero.com Subject: Re: [support] inter module communication, hooks and dependencies To: support@drupal.org Date: Friday, January 2, 2009, 9:56 AM
Hi Ivan,
I just looked over your post really quickly. But that quick glance makes me think you are need of one or both of the following modules in addition to nodewords:
http://drupal.org/project/nodewords_bypath http://drupal.org/project/nodewords_nodetype
best,
Shai content2zero
On Fri, Jan 2, 2009 at 9:17 AM, Ivan Sergio Borgonovo mail@webthatworks.it wrote:
Hi,
The actual problem is providing an API to let modules add META in a more structured way so that eg. the same META is not sent 2 times or module can decide to concatenate further meta or define a "owerwriteability" level.
I gave a look to nodewords aka Meta tags but I have stuff that aren't nodes (they aren't views or taxonomies either) that don't fit with the node paradigm too well.
nodewords provide a hook to 'prepare' META but it is on a module base. Nodewords needs to be aware of all the content types (or just pages, menu_hook etc...) it can support (*unless I'm missing something...*) but actually what know better which are the most suitable meta for a "content" should be the content producer (be it a "node" or just a MENU_CALLBACK). Other modules like nodewords_bypath and _nodetype do some extrawork to know what actually called the hook. But I'd find myself more comfortable with a different approach: - there is a common API that let me manage META - modules that want to add META use it - when everything is ready drupal_set_html_head get called
The problem is: - the API functions should be ready when other modules call them - drupal_set_html_head($meta) should be called last
If the weight of my meta module is high, other modules won't find the functions. If the weight of my module is low and I put drupal_set_html_head($meta) in the menu hook, drupal_set_html_head will be called before $meta had the chance to be filled by other modules.
I'd say this is a general common problem but I didn't find any "drupalish" way to solve it.
The easiest (and somehow elegant) way I thought to deal with this problem was to build up 2 modules with different weight): - meta_prepare (that will offer the functions) - meta_deliver (that will simply call drupal_set_html_head)
Is there a more drupalish way to deal with dependency and "order of execution" in drupal?
thanks
-- Ivan Sergio Borgonovo http://www.webthatworks.it
-- [ Drupal support list | http://lists.drupal.org/ ]
As with most mailing lists, no-one can do that but you.
Here you go: http://lists.drupal.org/listinfo/support
On Fri, Jan 2, 2009 at 10:05 AM, David Stein steinwrites4u@yahoo.comwrote:
please
--- On *Fri, 1/2/09, Shai Gluskin shai@content2zero.com* wrote:
From: Shai Gluskin shai@content2zero.com Subject: Re: [support] inter module communication, hooks and dependencies To: support@drupal.org Date: Friday, January 2, 2009, 9:56 AM
Hi Ivan,
I just looked over your post really quickly. But that quick glance makes me think you are need of one or both of the following modules in addition to nodewords:
http://drupal.org/project/nodewords_bypath http://drupal.org/project/nodewords_nodetype
best,
Shai content2zero http://content2zero.com/
On Fri, Jan 2, 2009 at 9:17 AM, Ivan Sergio Borgonovo < mail@webthatworks.it> wrote:
Hi,
The actual problem is providing an API to let modules add META in a more structured way so that eg. the same META is not sent 2 times or module can decide to concatenate further meta or define a "owerwriteability" level.
I gave a look to nodewords aka Meta tags but I have stuff that aren't nodes (they aren't views or taxonomies either) that don't fit with the node paradigm too well.
nodewords provide a hook to 'prepare' META but it is on a module base. Nodewords needs to be aware of all the content types (or just pages, menu_hook etc...) it can support (*unless I'm missing something...*) but actually what know better which are the most suitable meta for a "content" should be the content producer (be it a "node" or just a MENU_CALLBACK). Other modules like nodewords_bypath and _nodetype do some extrawork to know what actually called the hook. But I'd find myself more comfortable with a different approach:
- there is a common API that let me manage META
- modules that want to add META use it
- when everything is ready drupal_set_html_head get called
The problem is:
- the API functions should be ready when other modules call them
- drupal_set_html_head($meta) should be called last
If the weight of my meta module is high, other modules won't find the functions. If the weight of my module is low and I put drupal_set_html_head($meta) in the menu hook, drupal_set_html_head will be called before $meta had the chance to be filled by other modules.
I'd say this is a general common problem but I didn't find any "drupalish" way to solve it.
The easiest (and somehow elegant) way I thought to deal with this problem was to build up 2 modules with different weight):
- meta_prepare (that will offer the functions)
- meta_deliver (that will simply call drupal_set_html_head)
Is there a more drupalish way to deal with dependency and "order of execution" in drupal?
thanks
-- Ivan Sergio Borgonovo http://www.webthatworks.it
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Nobody can do that for you.
You can go to the place where you subscribed and read the instructions.
Henning
On Fri, Jan 2, 2009 at 4:05 PM, David Stein steinwrites4u@yahoo.com wrote:
please
--- On Fri, 1/2/09, Shai Gluskin shai@content2zero.com wrote:
From: Shai Gluskin shai@content2zero.com Subject: Re: [support] inter module communication, hooks and dependencies To: support@drupal.org Date: Friday, January 2, 2009, 9:56 AM
Hi Ivan,
I just looked over your post really quickly. But that quick glance makes me think you are need of one or both of the following modules in addition to nodewords:
http://drupal.org/project/nodewords_bypath http://drupal.org/project/nodewords_nodetype
best,
Shai content2zero
On Fri, Jan 2, 2009 at 9:17 AM, Ivan Sergio Borgonovo mail@webthatworks.it wrote:
Hi,
The actual problem is providing an API to let modules add META in a more structured way so that eg. the same META is not sent 2 times or module can decide to concatenate further meta or define a "owerwriteability" level.
I gave a look to nodewords aka Meta tags but I have stuff that aren't nodes (they aren't views or taxonomies either) that don't fit with the node paradigm too well.
nodewords provide a hook to 'prepare' META but it is on a module base. Nodewords needs to be aware of all the content types (or just pages, menu_hook etc...) it can support (*unless I'm missing something...*) but actually what know better which are the most suitable meta for a "content" should be the content producer (be it a "node" or just a MENU_CALLBACK). Other modules like nodewords_bypath and _nodetype do some extrawork to know what actually called the hook. But I'd find myself more comfortable with a different approach:
- there is a common API that let me manage META
- modules that want to add META use it
- when everything is ready drupal_set_html_head get called
The problem is:
- the API functions should be ready when other modules call them
- drupal_set_html_head($meta) should be called last
If the weight of my meta module is high, other modules won't find the functions. If the weight of my module is low and I put drupal_set_html_head($meta) in the menu hook, drupal_set_html_head will be called before $meta had the chance to be filled by other modules.
I'd say this is a general common problem but I didn't find any "drupalish" way to solve it.
The easiest (and somehow elegant) way I thought to deal with this problem was to build up 2 modules with different weight):
- meta_prepare (that will offer the functions)
- meta_deliver (that will simply call drupal_set_html_head)
Is there a more drupalish way to deal with dependency and "order of execution" in drupal?
thanks
-- Ivan Sergio Borgonovo http://www.webthatworks.it
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
Dear Group,
Is there a way to remove the "Submitted by ..." line that appears under the title of each page?
I poked around in Administration and could not find a way to do this.
Using Drupal 5, Bluemarine theme.
Thanks!
Go under administer/themes and there is a section to turn off submitted by.. line for each content type.
Thanks! Mark
On Jan 4, 2009, at 9:29 AM, Bob Smither wrote:
Dear Group,
Is there a way to remove the "Submitted by ..." line that appears under the title of each page?
I poked around in Administration and could not find a way to do this.
Using Drupal 5, Bluemarine theme.
Thanks!
-- Bob Smither Smither@C-C-I.com
-- [ Drupal support list | http://lists.drupal.org/ ]
On Sun, 2009-01-04 at 10:02 -0500, Mark Shropshire wrote:
Go under administer/themes and there is a section to turn off submitted by.. line for each content type.
Indeed there is - and I had looked at (but obviously not very closely) that page before posting! Many thanks Mark.
On Sun, 2009-01-04 at 10:02 -0500, Mark Shropshire wrote:
Go under administer/themes and there is a section to turn off
i don't find any such option, is it url or Navigation menu ?
submitted by.. line for each content type.
The url is admin/build/themes
On Sun, Jan 18, 2009 at 5:28 AM, sivaji j.g sivaji2009@gmail.com wrote:
On Sun, 2009-01-04 at 10:02 -0500, Mark Shropshire wrote:
Go under administer/themes and there is a section to turn off
i don't find any such option, is it url or Navigation menu ?
submitted by.. line for each content type.
-- Thanks a lot
http://ubuntuslave.blogspot.com/
[ Drupal support list | http://lists.drupal.org/ ]
On Sun, Jan 18, 2009 at 5:42 PM, William Smith william.darren@gmail.com wrote:
The url is admin/build/themes
go it.
Thank you :D
On Sun, Jan 18, 2009 at 5:46 PM, sivaji j.g sivaji2009@gmail.com wrote:
On Sun, Jan 18, 2009 at 5:42 PM, William Smith william.darren@gmail.com wrote:
The url is admin/build/themes
go it.
got*
On Fri, 2 Jan 2009 09:56:13 -0500 "Shai Gluskin" shai@content2zero.com wrote:
Hi Ivan,
I just looked over your post really quickly. But that quick glance makes me think you are need of one or both of the following modules in addition to nodewords:
http://drupal.org/project/nodewords_bypath http://drupal.org/project/nodewords_nodetype
I did really look in those modules but what I would like to overcome is the need of "knowledge" by nodewords of the "content" that it is going to be displayed (be it a node or "whatever").
What I was thinking is: - having a global object that store what other modules would like to see in the META (+ some logic to decide what actually get in) - having some mechanism that when when all the module got a chance to make a request to the global object will output the META
I could think of a hook mechanism that achieve this but it is not as simple and elegant as having 2 modules with different weight: - offering the object - output the META
The hook mechanism I'm thinking about is not that different from the one actually used by the above mentioned modules but it is convoluted.
I may use nodewords_bypath to add a set of "static" keywords to some content generated by a MENU_CALLBACK, but nodewords_bypath is not aware of the additional information associated with the MENU_CALLBACK that could be used to build up META.
So I may think that each module that would like to use nodewords provide a hook that pass some info and then the module try to "guess" which kind of content was being generated and add the meta... but choosing the meta is something that should be contextual to content creation... then an API may have a system to prioritise which META actually get chosen.
So back again to the general problem: inter module communication, hooks and dependencies...
In module world (out of core) the simplest thing I thought to overcome the workflow/existence of global object problem was to have 2 modules with 2 different weights...
The first one will provide the global object (and methods), the second one will trigger an action.
While it doesn't look terrible to actively use weights for 2 modules to solve this problem there may be other systems already integrated into drupal to deal with this kind of dependency.
Of course if what get into head (drupal_set_html_head()) was a structured object rather than a string... I wouldn't have to think to write a module so that each function can easily modify META... but that's another topic...
If there is no core global object and core global workflow and I need one... I wouldn't know how to build it in a module. That's what I'd like to learn.
thanks
On Fri, 2 Jan 2009 17:42:39 +0100, Ivan Sergio Borgonovo mail@webthatworks.it wrote:
Of course if what get into head (drupal_set_html_head()) was a structured object rather than a string... I wouldn't have to think to write a module so that each function can easily modify META... but that's another topic...
If there is no core global object and core global workflow and I need one... I wouldn't know how to build it in a module. That's what I'd like to learn.
thanks
I'd say you're on the right track with a hook. It's probably easier to explain with examples. I'd suggest something like:
hook_meta() { $info['keyword'] = array('foo', 'bar');
$info['some_key'] = 'some value';
return $info; }
hook_meta_alter() { // Because when you have a structured array, an alter hook is so dead simple to add it seems pointless not to. }
yourmodule_preprocess_page(&$vars) { // Invoke hook_meta_info() and the alter hook, get back the data from all modules, // format it, and inject it into the $vars['head'] variable as appropriate. }
Modules that need to do complex logic to figure out what tags to add can do so in their own hook_meta implementations. It also means no module has a hard-dependency on your module or vice versa, weight doesn't matter, and other modules can inject whatever meta tag info they need that you haven't thought of before.
Make sense? (Exact implementation is left as an exercise for the implementer.)
--Larry Garfield
I think this is a good idea.
This will let each module set it's own meta keywords and stuffs, like JS aggregation with drupal_add_js(), something like a meta aggregator hook or function would be great.
On Fri, 2009-01-02 at 10:56 -0600, Larry Garfield wrote:
On Fri, 2 Jan 2009 17:42:39 +0100, Ivan Sergio Borgonovo mail@webthatworks.it wrote:
Of course if what get into head (drupal_set_html_head()) was a structured object rather than a string... I wouldn't have to think to write a module so that each function can easily modify META... but that's another topic...
If there is no core global object and core global workflow and I need one... I wouldn't know how to build it in a module. That's what I'd like to learn.
thanks
I'd say you're on the right track with a hook. It's probably easier to explain with examples. I'd suggest something like:
hook_meta() { $info['keyword'] = array('foo', 'bar');
$info['some_key'] = 'some value';
return $info; }
hook_meta_alter() { // Because when you have a structured array, an alter hook is so dead simple to add it seems pointless not to. }
yourmodule_preprocess_page(&$vars) { // Invoke hook_meta_info() and the alter hook, get back the data from all modules, // format it, and inject it into the $vars['head'] variable as appropriate. }
Modules that need to do complex logic to figure out what tags to add can do so in their own hook_meta implementations. It also means no module has a hard-dependency on your module or vice versa, weight doesn't matter, and other modules can inject whatever meta tag info they need that you haven't thought of before.
Make sense? (Exact implementation is left as an exercise for the implementer.)
--Larry Garfield
On Fri, 2 Jan 2009 10:56:45 -0600 Larry Garfield larry@garfieldtech.com wrote:
On Fri, 2 Jan 2009 17:42:39 +0100, Ivan Sergio Borgonovo mail@webthatworks.it wrote:
Of course if what get into head (drupal_set_html_head()) was a structured object rather than a string... I wouldn't have to think to write a module so that each function can easily modify META... but that's another topic...
If there is no core global object and core global workflow and I need one... I wouldn't know how to build it in a module. That's what I'd like to learn.
thanks
I'd say you're on the right track with a hook. It's probably easier to explain with examples. I'd suggest something like:
hook_meta() {
[snip]
Make sense? (Exact implementation is left as an exercise for the implementer.)
Actually I was looking for a solution for D5 (sorry) and when you posted your suggestion I didn't have any reasonable book at hand. Now after some hours of sleep and reading the right book I find your solution very drupalish but a bit convoluted.
Supposing my META module is called mymeta...
I'll have to provide a
function mymeta_meta() {} hook that just take the place of a global object containing structured META information.
a
function mymeta_hook_info() { return array( 'mymeta' => array( 'meta' => array( 'output' => array( 'runs when' => t('Meta are going to be sent')... }
All modules that would like to change the meta should provide a anothermodule_meta_alter hook.
When I'm near to output the page (mymeta_preprocess_page) I'll run all _alter hook by calling module_invoke_all('meta','output'); (?)
Anyway this still make "context" recognition a bit hard. The _preprocess_page will have to introduce it's logic to actually know what's being displayed. Furthermore it looks a bit too much module centric.
eg. I've modules that do some stats and they are not "content" centred. For this kind of META source a "module based" approach may work... each module may actually offer an _alter hook to inject context independent keywords.
But suppose I've a page that consist of an "external" taxonomy, a list of items, an external feed of some sort and some content. Some of the events that may generate META may be context independent, some may be able to produce META efficiently just when the content is created etc... So while _preprocess_page may(?) be a good place to "close the circle" the hook system seems overly complicated to deal with the work-flow/dependency problem.
Surely _preprocess_page avoid the need of 2 modules one that define a global object and one that output head since in spite of module weight it exploit the internal work-flow of page creation.
On the other side relying on system.weight is a bit risky since we are missing a proper dependency tree in contrib and well it looks like a PITA to build one.
If you've any suggestion for D5 it'd be still welcome.
I'm trying to follow the 2 modules with different weight path (meta_prepare, meta_deliver) where the former has a function with a static wannabe array (just the way drupal_(s|g)et_html_head works but with a structured array in spite of a string)... but when meta_deliver menu get control... the static is empty (?).
Actually originally it was a whole class with methods to add meta-meta-data about priority etc... to META but to track down the problem I just cut&pasted and renamed the drupal_(s|g)et_html_head functions. But the static string is still empty when I call the get in the meta_deliver menu.
thanks