Marvin Scharle Posted October 10, 2014 Share Posted October 10, 2014 Hello everybody, It's another day - so it's time for a new module and this module is all about helping your site's visitors to store the pages they want to visit. Bookmarks is a module that delivers a straightforward API for storing pages, adding bookmark-comments and tags to them. You can create a bookmark for the current user for a page with a single line of code: $page->bookmark->save(); You can also add comments and tags to it: $page->bookmark->comment = 'Early in the morning'; $page->bookmark->tags = array('sleepy', 'bashful', 'sneezy'); $page->bookmark->save(); After having stored some bookmarks, you can fetch a user's bookmarks in this way: $user->bookmarks; You can find a live demo of the module here: http://nickel-1vn.lightningpw.com/ You can find the module and additional APIs here: https://github.com/conclurer/PageBookmarks The module is submitted for the module directory and should appear soon. Please leave a comment below to add feedback and / or feature wishes. Thanks in advance, Marvin 12 Link to comment Share on other sites More sharing options...
cstevensjr Posted October 10, 2014 Share Posted October 10, 2014 Very nice! 1 Link to comment Share on other sites More sharing options...
jacmaes Posted October 10, 2014 Share Posted October 10, 2014 Thanks, Marvin, this is really nice. Are you are using sessions to store the guest's bookmarks? If so, have you considered a cookie solution too so that visitors can come back days later and find their bookmarks again? 1 Link to comment Share on other sites More sharing options...
Soma Posted October 10, 2014 Share Posted October 10, 2014 How is this different than https://processwire.com/talk/topic/7044-release-flagpages/ ? Link to comment Share on other sites More sharing options...
Marvin Scharle Posted October 10, 2014 Author Share Posted October 10, 2014 Thanks for the Feedback! @jacmaes: Yes, the module currently uses the session to store the necessary information. I will place your feature wish on our roadmap. @Soma: Bookmarks supports Tagging and adding comments to the pages. Furthermore, it is not restricted to logged-on users. If you want to see the differences live, please check out our demo page. Link to comment Share on other sites More sharing options...
Martijn Geerts Posted October 10, 2014 Share Posted October 10, 2014 @Marvin, is there a configurable maximum amount of bookmarks and tags per person ? Can imagine a 'bot' continues tagging for an x amount of time. Link to comment Share on other sites More sharing options...
Marvin Scharle Posted October 10, 2014 Author Share Posted October 10, 2014 @Martijn Geerts: Currently the information for guest users is stored in the session (not in the database). Furthermore I believe, there is a max size for the session. Link to comment Share on other sites More sharing options...
OrganizedFellow Posted October 10, 2014 Share Posted October 10, 2014 I've encountered a bug when entering multiple tags, the bookmark gets saved multiple times. and when I attempt to delete one of the duplicates, they are all deleted. i accidentally saved a bookmark many times, how about disabling the Saved button after the first save? SUPER COOL, I can easily use this for an upcoming project. Would work ideal for a recipe type website. 1 Link to comment Share on other sites More sharing options...
Marvin Scharle Posted October 10, 2014 Author Share Posted October 10, 2014 @OrganizedFellow: Thanks for your report. The module does not write duplicates, on the demo site the output of all bookmarks is grouped by tag. So if you assign multiple tags to one bookmark, the bookmark will show up multiple times. The reason why the bookmark is deleted when you remove it from one tag, is that I was lazy writing the demo, so that the entire bookmark is deleted instead of one tag. The white Save-Button is rather an "update" button than a save button. You can assign or remove tags and change your comment afterwards and then save the bookmark again. Your example is a perfect use case for this module. Great idea! 1 Link to comment Share on other sites More sharing options...
Erik Richter Posted February 4, 2016 Share Posted February 4, 2016 I love the module, but it breaks the newest version of ProcessWire.. "Class cant be called again" or something. I guess its, because there is already a class called PageBookmarks integrated in ProcessWire (Bookmarks in the admin). You have a clue how to change this quickly? Would appreciate any help on this..! Link to comment Share on other sites More sharing options...
Macrura Posted February 5, 2016 Share Posted February 5, 2016 @Erik Richter, I believe your best chance of obtaining a fix for this would be to open an issue on Github: https://github.com/conclurer/PageBookmarks/issues Link to comment Share on other sites More sharing options...
Marco Angeli Posted March 1, 2019 Share Posted March 1, 2019 Hi Marvin, does this work with processwire 3? And, is there a demo online? Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now