Bookmarks

This module lets people bookmark (add to favorites) ExpressionEngine entries, members, comments and categories for quick access.

Checking/adding a bookmark

{exp:bookmarks:check type="comment" data_id="{comment_id}" form="yes" return="SAME_PAGE"}
{if not_bookmarked}
<input type="submit" value="add bookmark" />
{/if}
{if bookmarked}
<input type="submit" value="remove bookmark" />
{/if}
{/exp:bookmarks:check}

{exp:bookmarks:check} checks whether given data item was bookmarked. It can also display form to add/remove bookmark.

Conditional variables:

Tag parameters:

Lising bookmarked data

Entries

{exp:bookmarks:entries member_data="yes" custom_fields="yes"}
{if count==1}
<div class="box2">
<div class="header">
<div class="t">
<h3>MY BOOKMARKS</h3>
</div>
</div>
<ul class="broadcasters">
{/if}
<li>
<a class="img" href="{path=entry/{url_title}}"><img src="{photo_url}" alt="{title}" /></a>
<div class="text">
<a href="{path=entry/{url_title}}">{title}</a>
{if description}<p>{description}</p>{/if}}
</div>
</li>
{if count==total_results}
</ul>
</div>
{/if}
{/exp:bookmarks:entries}

{exp:bookmarks:entries} tag will display all channel entries bookmarked by user.

Tag parameters (all optional):

Single variables:

Additionally, if you have custom_fields="yes" set then all custom entry fields are parsed.

If you have member_data="yes" set then entry author's standard member profile fields are also parsed.

Members

{exp:bookmarks:members custom_fields="yes"}
{if count==1}
<div class="box2">
<div class="header">
<div class="t">
<h3>MY BOOKMARKED USERS</h3>
</div>
</div>
<ul class="broadcasters">
{/if}
<li>
<a class="img" href="{path=member/{username}}"><img src="{photo_url}" alt="{screen_name}" /></a>
<div class="text">
<a href="{path=member/{username}}">{screen_name}</a>
{if member_description}<p>{member_description}</p>{/if}}
</div>
</li>
{if count==total_results}
</ul>
</div>
{/if}
{/exp:bookmarks:members}

{exp:bookmarks:members} tag will display all site members bookmarked by user.

Tag parameters (all optional):

Single variables:

Additionally, if you have custom_fields="yes" set then all custom profile fields are parsed.

Comments

{exp:bookmarks:comments member_data="yes"}
{if count==1}
<div class="box2">
<div class="header">
<div class="t">
<h3>COMMENTS I LIKE</h3>
</div>
</div>
<ul class="broadcasters">
{/if}
<li>
<a class="img" href="{comment_url_title_auto_path}#c{comment_id}"><img src="{photo_url}" alt="{title}" /></a>
<div class="text">
<a href="{comment_url_title_auto_path}#c{comment_id}">{title}</a>
<p>{comment}</p>
</div>
</li>
{if count==total_results}
</ul>
</div>
{/if}
{/exp:bookmarks:comments}

{exp:bookmarks:comments} tag will display all comments bookmarked by user.

Tag parameters (all optional):

Single variables:

If you have member_data="yes" set then comment author's standard member profile fields are also parsed.

Categories

{exp:bookmarks:categories custom_fields="yes"}
{if count==1}
<div class="box2">
<div class="header">
<div class="t">
<h3>CATEGORIES I LIKE</h3>
</div>
</div>
<ul class="broadcasters">
{/if}
<li>
<a class="img" href="{path=site/category/{category_url_title}}"><img src="{category_image}" alt="{category_name}" /></a>
<div class="text">
<a href="{path=site/category/{category_url_title}}">{category_name}</a>
{if custom_category_desc}<p>{custom_category_desc}</p>{/if}}
</div>
</li>
{if count==total_results}
</ul>
</div>
{/if}
{/exp:bookmarks:categories}

{exp:bookmarks:categories} tag will display all categories bookmarked by user.

Tag parameters (all optional):

Single variables:

Additionally, if you have custom_fields="yes" set then all custom category fields are parsed.

Listing people who bookmarked certain data

{exp:comment:entries}
{if no_results}no comments{/if}
<li>
{comment}
<span>
Bookmarked by
{exp:bookmarks:by type="comment" data_id="{comment_id}" backspace="1"}
{if no_results}none{/if}
{screen_name},
{/exp:bookmarks:by}
</span>
</li>
{/exp:comment:entries}

{exp:bookmarks:by} tag will display list or all people who bookmarked certain data.

Tag parameters:

Single variables:

Additionally, if you have custom_fields="yes" set then all custom profile fields are parsed.

Total bookmarks

{exp:bookmarks:members total_only="yes"}
Members followed: {total_results} {/exp:bookmarks:members}
Categories watched: {exp:bookmarks:categories total_only="yes"}

total_only="yes" parameter added to any of module tags: entries/members/categories/comments/by will result in tag returning only total number of bookmarks by member for tag's datatype.

It can be used without closing tag. If closing tag is used, the number of bookmarks is contained in the only availabe variable, total_results

You can also use {exp:bookmarks:total} (as single tag or pair) to get tital number of member's bookmarks, irrespectible of type.

{exp:bookmarks:total}
{total_results} {/exp:bookmarks:total}

Top of page