Does anyone know a way to customize the page title (in the title tag) for a view? I asked about this for pages earlier and Bill suggested the page title module which works great - but there are two top level pages that are views that I need to customize the titles for and the page title module doesn't work with views. Since it's only two pages and the title isn't likely to change or at least not often I'm even willing to hard code it into template.php. what i tried so far is to add the following function to _phptemplate_variables:
if($vars['node']->nid == '12'){ $vars['head_title'] = "TEST"; }
I verified (through print statements) that the statement gets triggered on the proper page and that $vars['head_title'] is printing the current title. Furthermore a similar function is how the page title module does it. Yet when I print out the variable immediately after the function it still stays what it was. Full with print statements and output:
print($vars['head_title']); // prints: Photo Gallery | Timberpeg if($vars['node']->nid == '12'){ print(" changing to test "); // prints: changing to test - indicates it gets triggered $vars['head_title'] = "TEST"; } print($vars['head_title']); // prints: Photo Gallery | Timberpeg
thanks .sander
Hello
I have this big bug when I add content from a content wich I created :
"Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 4104 bytes) in /var/www/drupal/modules/link/link.module on line 574"
I find some informations on drupal.org : http://drupal.org/node/76156 In this post the author says : "
memory_limit = 12M to your php.ini file (recommended, if you have access) ini_set('memory_limit', '12M'); in your sites/default/settings.php file php_value memory_limit 12M in your .htaccess file in the Drupal root" I do everything of this list, but it doesn't work again.
Somebody have a solution please ?
raf
--------------------------------- Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
In response to Raf Raf rafyven@yahoo.fr:
Hello
I have this big bug when I add content from a content wich I created :
"Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 4104 bytes) in /var/www/drupal/modules/link/link.module on line 574"
I find some informations on drupal.org : http://drupal.org/node/76156 In this post the author says : "
memory_limit = 12M to your php.ini file (recommended, if you have access) ini_set('memory_limit', '12M'); in your sites/default/settings.php file php_value memory_limit 12M in your .htaccess file in the Drupal root" I do everything of this list, but it doesn't work again.
Somebody have a solution please ?
You're _exceeding_ 12M. Have you raised the limit above 12M?
I increased at 30mb the limit in the 3 files php.ini sites/default/settings.php .htaccess file in the Drupal root
I removed also some modules, but I have the same response, or the blank screen of death.
please who knows a solution ? who has the same situatin ?
raf
Bill Moran wmoran@potentialtech.com a écrit : In response to Raf Raf :
Hello
I have this big bug when I add content from a content wich I created :
"Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 4104 bytes) in /var/www/drupal/modules/link/link.module on line 574"
I find some informations on drupal.org : http://drupal.org/node/76156 In this post the author says : "
memory_limit = 12M to your php.ini file (recommended, if you have access) ini_set('memory_limit', '12M'); in your sites/default/settings.php file php_value memory_limit 12M in your .htaccess file in the Drupal root" I do everything of this list, but it doesn't work again.
Somebody have a solution please ?
You're _exceeding_ 12M. Have you raised the limit above 12M?
Check if the ini changes have been effected by printing the phpinfo. If not, please restart server for php.ini settings to take effect.
Shyamala ----- Original Message ----- From: Raf Raf To: support@drupal.org Sent: Thursday, September 27, 2007 5:05 AM Subject: [support] RE : Re: "Allowed memory size ....exhausted......"
I increased at 30mb the limit in the 3 files php.ini sites/default/settings.php .htaccess file in the Drupal root
I removed also some modules, but I have the same response, or the blank screen of death.
please who knows a solution ? who has the same situatin ?
raf
Bill Moran wmoran@potentialtech.com a écrit : In response to Raf Raf :
> Hello > > I have this big bug when I add content from a content wich I created : > > "Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 4104 bytes) in /var/www/drupal/modules/link/link.module on line 574" > > I find some informations on drupal.org : http://drupal.org/node/76156 > In this post the author says : > " > > memory_limit = 12M to your php.ini file (recommended, if you have access) > ini_set('memory_limit', '12M'); in your sites/default/settings.php file > php_value memory_limit 12M in your .htaccess file in the Drupal root" > I do everything of this list, but it doesn't work again. > > Somebody have a solution please ?
You're _exceeding_ 12M. Have you raised the limit above 12M?
-- Bill Moran http://www.potentialtech.com -- [ Drupal support list | http://lists.drupal.org/ ]
------------------------------------------------------------------------------ Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
------------------------------------------------------------------------------
-- [ Drupal support list | http://lists.drupal.org/ ]
in the phpinfo, it's ok
memory_limit local value : 30M master value : 30M
Shyamala shyamala@netlinkindia.com a écrit : Check if the ini changes have been effected by printing the phpinfo. If not, please restart server for php.ini settings to take effect.
Shyamala ----- Original Message ----- From: Raf Raf To: support@drupal.org Sent: Thursday, September 27, 2007 5:05 AM Subject: [support] RE : Re: "Allowed memory size ....exhausted......"
I increased at 30mb the limit in the 3 files php.ini sites/default/settings.php .htaccess file in the Drupal root
I removed also some modules, but I have the same response, or the blank screen of death.
please who knows a solution ? who has the same situatin ?
raf
Bill Moran wmoran@potentialtech.com a écrit : In response to Raf Raf :
Hello
I have this big bug when I add content from a content wich I created :
"Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 4104 bytes) in /var/www/drupal/modules/link/link.module on line 574"
I find some informations on drupal.org : http://drupal.org/node/76156 In this post the author says : "
memory_limit = 12M to your php.ini file (recommended, if you have access) ini_set('memory_limit', '12M'); in your sites/default/settings.php file php_value memory_limit 12M in your .htaccess file in the Drupal root" I do everything of this list, but it doesn't work again.
Somebody have a solution please ?
You're _exceeding_ 12M. Have you raised the limit above 12M?
In response to Raf Raf rafyven@yahoo.fr:
in the phpinfo, it's ok
memory_limit local value : 30M master value : 30M
So you're saying that the error now claims that you're exceeding 30M?
This is pretty crazy. I can't imagine that Drupal should be using that much memory under any conditions.
Somewhere down in this tangled maze of an email, you said "I have this big bug when I add content from a content wich I created"
Does that mean you added PHP code to Drupal? If that's the case, it's quite possible that you're using very wasteful techniques with memory in your code.
Otherwise, try bumping the limit up even further until (little bits at a time) until the script has enough memory.
However, I can't imagine a legitimate use of Drupal that should require more than 30M. And if individual scripts are doing that on a regular basis, you're going to need a LOT of memory to run this site. You're probably going to need to provide a lot more information to track down the problem.
On the counter-point, however, my site is using the default of 128M, which is obscenely excessive in my opinion, but I've never really looked at it before, so it's possible that there's some bloated code in Drupal that's using 50 or 60M.
Shyamala shyamala@netlinkindia.com a écrit : Check if the ini changes have been effected by printing the phpinfo. If not, please restart server for php.ini settings to take effect.
Shyamala ----- Original Message ----- From: Raf Raf To: support@drupal.org Sent: Thursday, September 27, 2007 5:05 AM Subject: [support] RE : Re: "Allowed memory size ....exhausted......"
I increased at 30mb the limit in the 3 files php.ini sites/default/settings.php .htaccess file in the Drupal root
I removed also some modules, but I have the same response, or the blank screen of death.
please who knows a solution ? who has the same situatin ?
raf
Bill Moran wmoran@potentialtech.com a écrit : In response to Raf Raf :
Hello
I have this big bug when I add content from a content wich I created :
"Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 4104 bytes) in /var/www/drupal/modules/link/link.module on line 574"
I find some informations on drupal.org : http://drupal.org/node/76156 In this post the author says : "
memory_limit = 12M to your php.ini file (recommended, if you have access) ini_set('memory_limit', '12M'); in your sites/default/settings.php file php_value memory_limit 12M in your .htaccess file in the Drupal root" I do everything of this list, but it doesn't work again.
Somebody have a solution please ?
You're _exceeding_ 12M. Have you raised the limit above 12M?
-- Bill Moran http://www.potentialtech.com -- [ Drupal support list | http://lists.drupal.org/ ]
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
-- [ Drupal support list | http://lists.drupal.org/ ]-- [ Drupal support list | http://lists.drupal.org/ ]
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Bill Moran schrieb:
In response to Raf Raf rafyven@yahoo.fr:
in the phpinfo, it's ok
memory_limit local value : 30M master value : 30M
So you're saying that the error now claims that you're exceeding 30M?
This is pretty crazy. I can't imagine that Drupal should be using that much memory under any conditions.
I just got sent a mail including a tarred up Drupal site using ~ 50 contrib modules. I figure that this site easily uses 64M.
Also, the total amount of memory depends on how much data you load.
Try the event calendars in event module 5.1 with several 100 of nodes....
Cheers, Gerhard
I do everything : - empty the cache, - increase the memory in the files, - check the good configuration with systeminfo, line memory_value =30
and I have this white screen when I add content in the link field.
what's happen ? there is some experience or documentation about it ? I'm going crazy with this.
raf
Gerhard Killesreiter gerhard@killesreiter.de a écrit : -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Bill Moran schrieb:
In response to Raf Raf :
in the phpinfo, it's ok
memory_limit local value : 30M master value : 30M
So you're saying that the error now claims that you're exceeding 30M?
This is pretty crazy. I can't imagine that Drupal should be using that much memory under any conditions.
I just got sent a mail including a tarred up Drupal site using ~ 50 contrib modules. I figure that this site easily uses 64M.
Also, the total amount of memory depends on how much data you load.
Try the event calendars in event module 5.1 with several 100 of nodes....
Cheers, Gerhard
ok, I identified the problem : it's the link module of cck. because when I do a test with another field - simple text field - it's ok, no white screen after submiting.
how can I resolve it ? I need links for my content.
Raf Raf rafyven@yahoo.fr a écrit : I do everything : - empty the cache, - increase the memory in the files, - check the good configuration with systeminfo, line memory_value =30
and I have this white screen when I add content in the link field.
what's happen ? there is some experience or documentation about it ? I'm going crazy with this.
raf
Gerhard Killesreiter gerhard@killesreiter.de a écrit : -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Bill Moran schrieb:
In response to Raf Raf :
in the phpinfo, it's ok
memory_limit local value : 30M master value : 30M
So you're saying that the error now claims that you're exceeding 30M?
This is pretty crazy. I can't imagine that Drupal should be using that much memory under any conditions.
I just got sent a mail including a tarred up Drupal site using ~ 50 contrib modules. I figure that this site easily uses 64M.
Also, the total amount of memory depends on how much data you load.
Try the event calendars in event module 5.1 with several 100 of nodes....
Cheers, Gerhard
We run Drupal 4.7 with a memory_limit of 64M -- but then we also have 110 modules enabled.
On 9/27/07, Gerhard Killesreiter gerhard@killesreiter.de wrote:
Bill Moran schrieb:
In response to Raf Raf rafyven@yahoo.fr:
in the phpinfo, it's ok
memory_limit local value : 30M master value : 30M
So you're saying that the error now claims that you're exceeding 30M?
This is pretty crazy. I can't imagine that Drupal should be using that much memory under any conditions.
I just got sent a mail including a tarred up Drupal site using ~ 50 contrib modules. I figure that this site easily uses 64M.
Also, the total amount of memory depends on how much data you load.
Try the event calendars in event module 5.1 with several 100 of nodes....
Cheers, Gerhard
Anyone have an idea how to do this? I still haven't figured it out.
thanks .sander
sander-martijn wrote:
Does anyone know a way to customize the page title (in the title tag) for a view? I asked about this for pages earlier and Bill suggested the page title module which works great - but there are two top level pages that are views that I need to customize the titles for and the page title module doesn't work with views. Since it's only two pages and the title isn't likely to change or at least not often I'm even willing to hard code it into template.php. what i tried so far is to add the following function to _phptemplate_variables:
if($vars['node']->nid == '12'){ $vars['head_title'] = "TEST"; }
I verified (through print statements) that the statement gets triggered on the proper page and that $vars['head_title'] is printing the current title. Furthermore a similar function is how the page title module does it. Yet when I print out the variable immediately after the function it still stays what it was. Full with print statements and output:
print($vars['head_title']); // prints: Photo Gallery | Timberpeg if($vars['node']->nid == '12'){ print(" changing to test "); // prints: changing to test - indicates it gets triggered $vars['head_title'] = "TEST"; } print($vars['head_title']); // prints: Photo Gallery | Timberpeg
thanks .sander
I don't know if this would work, as I haven't tried this yet, so, take this for what it's worth.
Which ain't much...
How about a function in template.php that would grab a title generated from some php in the view header?
This way, it would Just Work in any view, and you wouldn't need to hardcode anything --
Cheers,
Bill
sander-martijn wrote:
Anyone have an idea how to do this? I still haven't figured it out.
thanks .sander
sander-martijn wrote:
Does anyone know a way to customize the page title (in the title tag) for a view? I asked about this for pages earlier and Bill suggested the page title module which works great - but there are two top level pages that are views that I need to customize the titles for and the page title module doesn't work with views. Since it's only two pages and the title isn't likely to change or at least not often I'm even willing to hard code it into template.php. what i tried so far is to add the following function to _phptemplate_variables:
if($vars['node']->nid == '12'){ $vars['head_title'] = "TEST"; }
I verified (through print statements) that the statement gets triggered on the proper page and that $vars['head_title'] is printing the current title. Furthermore a similar function is how the page title module does it. Yet when I print out the variable immediately after the function it still stays what it was. Full with print statements and output:
print($vars['head_title']); // prints: Photo Gallery | Timberpeg if($vars['node']->nid == '12'){ print(" changing to test "); // prints: changing to test - indicates it gets triggered $vars['head_title'] = "TEST"; } print($vars['head_title']); // prints: Photo Gallery | Timberpeg
thanks .sander
Thanks - that's a good idea. I'll try it out and let you know what happens.
Bill Fitzgerald wrote:
I don't know if this would work, as I haven't tried this yet, so, take this for what it's worth.
Which ain't much...
How about a function in template.php that would grab a title generated from some php in the view header?
This way, it would Just Work in any view, and you wouldn't need to hardcode anything --
Cheers,
Bill
sander-martijn wrote:
Anyone have an idea how to do this? I still haven't figured it out.
thanks .sander
sander-martijn wrote:
Does anyone know a way to customize the page title (in the title tag) for a view? I asked about this for pages earlier and Bill suggested the page title module which works great - but there are two top level pages that are views that I need to customize the titles for and the page title module doesn't work with views. Since it's only two pages and the title isn't likely to change or at least not often I'm even willing to hard code it into template.php. what i tried so far is to add the following function to _phptemplate_variables:
if($vars['node']->nid == '12'){ $vars['head_title'] = "TEST"; }
I verified (through print statements) that the statement gets triggered on the proper page and that $vars['head_title'] is printing the current title. Furthermore a similar function is how the page title module does it. Yet when I print out the variable immediately after the function it still stays what it was. Full with print statements and output:
print($vars['head_title']); // prints: Photo Gallery | Timberpeg if($vars['node']->nid == '12'){ print(" changing to test "); // prints: changing to test - indicates it gets triggered $vars['head_title'] = "TEST"; } print($vars['head_title']); // prints: Photo Gallery | Timberpeg
thanks .sander
Doesn't look like that will work. It seems to only allow you to edit the header. I think it executes this php code fairly late in the game (although I'm not positive about this). The only data I can even get into there is using global $current_view; print_r($current_view); but nothing related to the title there. Also editing any variables doesn't seem to have an affect outside of the realm of the header area.
thanks for the idea though - that would have been pretty slick. .s
Bill Fitzgerald wrote:
I don't know if this would work, as I haven't tried this yet, so, take this for what it's worth.
Which ain't much...
How about a function in template.php that would grab a title generated from some php in the view header?
This way, it would Just Work in any view, and you wouldn't need to hardcode anything --
Cheers,
Bill
sander-martijn wrote:
Anyone have an idea how to do this? I still haven't figured it out.
thanks .sander
sander-martijn wrote:
Does anyone know a way to customize the page title (in the title tag) for a view? I asked about this for pages earlier and Bill suggested the page title module which works great - but there are two top level pages that are views that I need to customize the titles for and the page title module doesn't work with views. Since it's only two pages and the title isn't likely to change or at least not often I'm even willing to hard code it into template.php. what i tried so far is to add the following function to _phptemplate_variables:
if($vars['node']->nid == '12'){ $vars['head_title'] = "TEST"; }
I verified (through print statements) that the statement gets triggered on the proper page and that $vars['head_title'] is printing the current title. Furthermore a similar function is how the page title module does it. Yet when I print out the variable immediately after the function it still stays what it was. Full with print statements and output:
print($vars['head_title']); // prints: Photo Gallery | Timberpeg if($vars['node']->nid == '12'){ print(" changing to test "); // prints: changing to test - indicates it gets triggered $vars['head_title'] = "TEST"; } print($vars['head_title']); // prints: Photo Gallery | Timberpeg
thanks .sander
I just figured it out - apparently it has to be within if ($hook == 'page') {} in order to work. As soon as I put it in there (where the page_title module code lives) it worked.
if ($hook == 'page') { if (module_exists('page_title')) { $vars['head_title'] = page_title_page_get_title(); $tit = page_title_page_get_title(); if($tit == "Photo Gallery | Timberpeg"){ $vars['head_title'] = "HAR HAR HAR!"; } else if($tit == "News & Events | Timberpeg"){ $vars['head_title'] = "HAR TOO!!!"; } } }
Not maintainable and not recommended, but will get me through this hurdle. If anyone has a better suggestion I'm still open to it as this is not the best idea.
sander-martijn schrieb:
I just figured it out - apparently it has to be within if ($hook == 'page') {} in order to work. As soon as I put it in there (where the page_title module code lives) it worked. [snip] Not maintainable and not recommended, but will get me through this hurdle. If anyone has a better suggestion I'm still open to it as this is not the best idea.
Hi. Did you try to set the page_header (title) within the argument handling code of the view? I'm using this in a view to "unset" the title if there are any arguments: <code> if (count($args) > 0) { $view->page_header = ''; } </code>
hth,
Stefan
Stefan Borchert wrote:
sander-martijn schrieb:
I just figured it out - apparently it has to be within if ($hook == 'page') {} in order to work. As soon as I put it in there (where the page_title module code lives) it worked. [snip] Not maintainable and not recommended, but will get me through this hurdle. If anyone has a better suggestion I'm still open to it as this is not the best idea.
Hi. Did you try to set the page_header (title) within the argument handling code of the view? I'm using this in a view to "unset" the title if there are any arguments:
<code> if (count($args) > 0) { $view->page_header = ''; } </code>
hth,
Stefan
This would work if the page_header and the page_title were the same thing -- I think what they're looking for is the ability to make them different -- if this worked, it would be pretty sweet, though.
In thinking about this more, the cleanest way through this is probably a helper module for views that inserts an additional field into the form to add new views -- this field would contain the custom page title.
Cheers,
Bill