Hello,
First I want to thank all the contributers for this outstanding product, it's very useful for me, and I would like to be a part of Drupal in the future. It was love at first sight!
I want to do a proposal and a sketch for a new but quite simple module, maybe you want to give me some useful suggestions.
The module imitates the star function of Google's Gmail. When you click on the star (in front of a e-mail) you will bookmark it automatically, then you will find it in the starred list, that contains all the (important) starred e-mails.
This is the essence of the new module, but nevertheless I want to make it more general:
>> You can use your own icons and labels etc.
>> It's possible to add more than 1 different "star"-field to a node.
>> The information is saved as a normal field (you can filter it with views)
>> You can do the action not only when you are editting a node, but also in a views generated list and on the node itself.
How do I think ik can be realized (Apologize me, because I'm a drupal noob)
Modules who uses techniques useful for this module is the fivestar-module and the unflag module.
The fivestar-module contains a javascript which enables the user to select an icon (on the fly) and submit this to the database without refreshing. The star module could be seen as a one star voting field with a different icon and most of the time generated multple times.
Another module is the flag-module. If you could edit this module on such a way that it is possible to edit the labes, remove the confirmation pages, use icons instead of text and enable it in the views-list, you would get a approach.
My approach is to create an own field ( with selecting boxes) and your own labels etc in the cck-module. Then use javascript to show instead of a checkbox a selectable icon ( this is what the fivestar module does as well) You should modify this on such a way that you can click on the icon on the node ( fivestar again) or in the views list.
for example, create a cck field with to select-boxes -->
Starred? (this is just the label)
Yes (1) (idemdito)
No (0) (idemdito)
then create a css (which enables a selectable star ( a grey and yellowstar) and thus turn the normal form into a interactive thing.
this little field should be editable on the node and in the viewslist.
hmmmm, actually it's just an extensive ckk-field.....
I will play with it and try to create something, maybe somebody could give me a suggestion.
Thanks
Comments
checkbox in views
a selectable icon is no problem (use jquery), making checkboxes with cck is not a problem either, but how could I put checkboxes in front of a node-title on a views generated page and on a full node (not in the edit form, but for example below the node description). Is there a built-in function? I think it should use some ajax to save the value automatically..
I hope somebody would like to respond, I am not very clear, but I am not yet used to drupal language.
Have you looked at the Click2Bookmark module?
If I understand you want to give people the ability to bookmark nodes they view. I have not used the Click2Bookmark module but it sound like it might be close to what you are after.
Views Bookmarks
I am now using Views Bookmarks, this works ( you can bookmark directly in a views list) and you can edit and manage different types of bookmark.
The only thing I need to change is that I can change the bookmarklink into a image ( and use some javascript to get a rollover effect) or to change the text into a checkbox instead of just normal text ( and then use some javascript as well). How could I modify this module?
Title Company Rating Location Date submitted bookmark
- - - - - bookmark this
into
Title Company Rating Location Date submitted bookmark
- - - - - *
*a star icon (or other image).
show the content of a link as html
you can submit htmlcode as an url, pure html is stored in the database, but it is showed als a string, how could I change that.
this is what you see:
<img src="http://www.localhost/jms/files/icon.gif">A starting point
There is no need to modify the module, you can write a new module that modifies the link. Here is a simple version with static images for the link (module in sample code is link_alter, you would place this in link_alter.module and also need a link_alter.info)
thanks for help
Dear Nevets,
Thank you for your code. I installed the module (renamed the file+info etc). Put two icons on my localhost, made a new bookmark with titles: "bookmark this" and "unbookmark this". Other bookmarks I deleted, and I took care this was number1 ('links_bookmark_1'). Then I activated the module, but it doesn't work or I could n't see any change at this moment. Maybey I did something wrong, really I'm not yet into drupal coding.
What I don't understand is how the function in the module link_alter_link_alter is getting activated, when is the function used(a hookpoint?). I even changed the name into link_alter, because i thought maybe you made some typo.
Could you give me a little bit more support, sorry for my ignorance, I really should read some good books on Drupal, I will.
ps: maybe I am a little bit sleepy, because I really spent a lot of time to make my wish come true ;-)
UPDATE: I think there's is something wrong with "'links_bookmark_1'" this is the endresult in my view:
<td class="view-field view-field-views-bookmark-nodes-4-vbid"><a href="/jms/views_bookmark/mark/91/4?destination=jobs" title="s">bookmark this</a></td> </tr>The code is probably a little simple minded.
First off the code is activated as the last step when build the links for nodes. I only did a quick check and the code could probably be smarter. As the first line of the function add
and you should see a member of the link you want to modify. I would expect the index to be of the form 'links_bookmark_N' where N is a number. The index you find would be used to replace all instances of links_bookmark_1. As you figured out it matches on the title of the link, replacing the text with an html img tag and setting html to true so the image will show.