By Peter76 on
I would like to know in which file i must apply this: http://drupal.org/node/122578 ?
Im new at Drupal so I have a lot of problems :)
I would like to know in which file i must apply this: http://drupal.org/node/122578 ?
Im new at Drupal so I have a lot of problems :)
Comments
Anyone?
Anyone?
Try this
Drupal 5.7 and 6.x already have this feature built in. On the admin/settings/admin page, there's a checkbox to 'use administration theme for content editing'. If you're using an older version of 5.x, then you need the code in the post that you referenced.
To use the code, you need to create a new module. So do this: create a folder called adminedit. In this folder, create two files. The first will be the module info file. Give it a name of adminedit.info, and insert this code:
Give the second file a name of adminedit.module, and insert this code:
Now copy the adminedit folder to your sites/all/modules folder, enable the module, and you're good to go.
Thanks for help. It
Thanks for help. It works.
And just one thing Drupal 5.7 doesnt have this feature built in.
Yep
You're right... it was in 5.6, and appears to have been backed out of 5.7.
You can always put it back in
You can always put the option back in with form alter if you need to turn it off and on
then remember to check if the variable is true when you change the $custom_theme global variable
Timing issue
I came across a timing issue with this on one site. On some node/N/edit pages (editing events), init_theme (includes/theme.inc) was being called before the hook_menu function, so the non-admin theme was used. This was fixed by putting the code in hook_init instead of hook_menu. However this may not be suitable if you use aggressive mode caching.
Dave Jenkins
Circle Interactive - UK Drupal development and hosting
hook_init
For the people who are having trouble getting the module to work, what davej is saying is to replace
function adminedit_menu() {with
function adminedit_init() {and just to be sure that everything gets registered properly (actually voodoo magic?), go to the modules page and click "Save configuration".
(Username formerly my full name, Richard Eriksson.)
Works like a charm! Thank
Works like a charm! Thank you very much.
I've changed some of the code to also use admin theme for blocks but I think I did something wrong cause it doesn't work for blocks:
Any ideas on this?
________________
Live fast die young
Excellent!
This plug & play module code is great!
Works like a charm, really have no idea why it's not part of:
- http://drupal.org/node/122578
Thnx very much!
___________________
discover new oceans
lose sight of the shore
It looks pretty handy, but
It looks pretty handy, but still won't work for the Block Admin page.The probable reason, I think because the block module is applying the theme while it's building the form, it's able to override whatever theme is set globally.
I found that if I override the global $custom_theme variable in block.admin.inc I can force it to display the admin theme. I know that making modifications inside of core is frowned upon though.
I've looked into that as
I've looked into that as well but then quickly stopped after reading so many posts about altering core or modules...
Haven't had time for it but if I understand Drupal correctly there should be a way to alter this function without altering the module. Remember reading about hook_alter.... will try to look into it when I have time!
Cheers
________________
Live fast die young
block module is parsing the theme files for regions
I would suggest that the block module is looking at the theme files to identify the regions to propose for configuration. And then it becomes tricky :-)
You are very right and I
You are very right and I found it hard to alter it so that the block module gets the regions first and then still use the admin theme... haven't worked on it for a while. Might pick it up again when things calm down here...
Cheers
________________
Live fast die young