Jump to content

Page Bookmarks


Marvin Scharle
 Share

Recommended Posts

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

  • Like 12
Link to comment
Share on other sites

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?

  • Like 1
Link to comment
Share on other sites

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

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.

;)

  • Like 1
Link to comment
Share on other sites

@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!

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

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

  • 3 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...