Hi guys,
I noticed today that I was getting meta tags when in the administration screen. I think that does not make any sense because 99% of the tags that you offer are for search engines, and the other 1% don't have much of a use in the administration pages. This being said, I'll listen to your arguments. Mine goes like this: If I don't install your module, my administration screens work perfectly. Once installed, it's a bit slower for no apparent reason.
So... this being said, I have a rough patch attached that works for me. It could be a problem if some silly billy was to use admin/ as a sub-path for normal nodes, but that's more their problems than mine. Frankly?!
Anyway, the patch is very simple and skips all the loops, includes, etc. that the nodewords generates when in the administration screens.
Btw, in most cases, we could also remove the meta tags when a user is logged in since they are there mainly for search engines... That again would save a lot of processing time, hard drive/database accesses...
That would be the following but I'm wondering whether the Drupal Core caches would interfere?
global $user;
if (arg(0) == 'admin' || $user->uid) { // patch does not include the $user->uid test
return;
}
Side effect of this test: if the user cannot see the meta tags, editing them in a page is not reflected unless the user logs out which can be a problem...
Thank you.
Alexis
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | nodewords-6.x-skip_admin_b-1.x.patch | 2.58 KB | AlexisWilke |
| nodewords-6.x-skip_admin-1.x.patch | 398 bytes | AlexisWilke |
Comments
Comment #1
AlexisWilke commentedComment #2
dave reidThis makes perfect sense to me, although we should add some validation to the custom page meta tags UI to not allow paths starting with admin/*.
Comment #3
AlexisWilke commentedOkay, there is a patch that checks the path for admin. I did not test the code though 8-]
I added something in the .install to check whether existing entries exist. I do not delete anything thinking that some people may get mad if you do that under their feet... Editing will work, but not the saving.
Thank you.
Alexis
Comment #4
dave reidI revised and fixed it to work. :)
http://drupalcode.org/project/nodewords.git/commit/32b40f8
Comment #5
AlexisWilke commentedgreat thank you 8-)
Alexis