Active
Project:
Javascript Tools
Version:
5.x-0.6
Component:
Activeedit
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 May 2007 at 17:41 UTC
Updated:
10 Nov 2007 at 07:24 UTC
In the theme folder there are a couple of files with the same name as the themes used in Drupal.
How do they work? How do I declare my own selectors for my custom theme?
I've tried to create my own file and that directory and change the template.php, but I can't get it to work so I guess that this is the wrong approach?
Sorry for asking, but I can't find any documentation on this module :)
Comments
Comment #1
nedjoYou're right to ask, I haven't found a lot of time for documenting and a nudge is welcome.
I've done up two things:
1. added theming instructions to the module's readme
2. written a small helper module to generate stub theme functions
See this commit:
http://drupal.org/cvs?commit=67483
The helper module won't be included in the stable release but will be in the CVS HEAD version.
Pls review and ask more questions.
Comment #2
nedjoAnd if you produce .inc files for themes that are posted on drupal.org please post the .inc files as new issues here so I can include them in the module download.
Comment #3
NeoID commentedThanks for your nice reply.
First of all, isn't there a <?php tag missing on the top of the function (when looking at the sample the module produces)?
I've tried to copy the whole thing into myowntheme.inc file and tried to remove the selector for the logo, but nothing really happens... :)
Comment #4
nedjoThe script is only generating all the elements and their default selectors. You need to figure out, for your theme, what the correct jQuery selectors for these page elements are. This is not something that can be done automatically. You need to look through the HTML produced by your theme and figure it out. See the text I added to the README for a link for learning how to use jQuery selectors. I can't do this work for you!
It may help to start with an existing theme supported by a .inc file, e.g., bluemarine. Find the elements that these selectors select. Then, in your theme, look at a rendered page and figure out what the equivalent elements are, and how they can be selected.
If the selectors are the same as the defaults, you may delete their lines in the .inc file--the defaults are enough.
If they are different, you need to change the defaults to the correct values for your theme.
Comment #5
NeoID commentedSounds like a little misunderstanding, however, I'm using a modified version of bluemarin so all the names are correct.
Anyway, thanks for the information, looks like I get it working, but just a quick question at the end, how to remove selectors from the theme, for example the $selectors['logo_path']? :)
Comment #6
nedjoDo you mean, how to get activeedit not to attach to an item?
That isn't formally supported, but I guess you could try this:
Give the item a selector in the .inc file that doesn't exist, e.g. '#nothing'. That way, I think, the script should look for it, not find it, and so not attach.
Comment #7
NeoID commentedYou are right, that's the solution I'm currently using, but I don't guess that this is the best solution :P
What about removing all default selectors and only depend on the inc-file in the future?
Anyway, you do a great work and this module is really great! :)
Comment #8
tancnedjo, I'm currently struggling with activeedit and wondering if you can shed some light on it for me.
1. Is it possible to use this module to edit cck fields?
2. If so, how would I implement it in the themes.inc file? Say I have a node field with a name of field_news_body how would I specify it in the themes.inc file?
I understand traversing the DOM but I don't understand how this module knows what to update given just a selector.
What I'd like to do is enable my users to be able to update fields in a specific node type without needing to edit the whole node. Is this something this module is capable of or is it limited to certain default fields?
Thanks for you time.