Community articleAdding popular bookmarks to a web page
Added by IBM contributorIBM on June 17, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Embed the most popular bookmarks into your web pages. Your web application can use this resource to enable users to see and navigate to the most popular bookmarks embedded on your web page.



Embed the most popular bookmarks into your web pages. Your web application can use this resource to enable users to see and navigate to the most popular bookmarks embedded on your web page.

This lists the bookmarks that multiple users have bookmarked recently. It captures the bookmarks that are displayed in the Most Bookmarked in the last 30 days section of the Popular tab of the Bookmarks application.

Note: The administrator can change the number of days from 30 to something different.

To find out how to add all bookmarks to a page, retrieve the resources described in Adding a set of bookmarks to a web page and Adding a list of bookmarks to a web page.

Note: Search can only find bookmarks that the indexer has processed. The indexing interval is stored in a configuration property that your administrator can configure. See Managing search and index operations in the Administering Bookmarks section of the IBM® Connections product documentation for more details.

Resource information


/lisnippet/popular

Retrieves popular bookmarks. Returns JavaScript™ code that emits XHTML containing the search results, with each result specified in a <li> element.

/snippet/popular

Retrieves popular bookmarks. Returns JavaScript code that emits XHTML containing the search results, with each result specified in a <div> element.

Use one or more of the input parameters to narrow the search. Separate multiple parameters with an ampersand (&).
Table 1. Input parameters

Parameter
Description
custom_font
Specifies the style in which to display the list. Provide cascading style sheet (CSS) attribute:value pairs separated by semicolons to define the font style. For example: http://example.com:9083/dogear/snippet/popular?custom_font=color:black;font-size:18pt
lang
Language code. Language of the strings in the output. If not specified, the first matching browser language is used, if available. The server then redirects the request to add this parameter to the URL. Specify this parameter to avoid a redirect.
page
Page number. Specifies the page to be returned. The default value is 1, which returns the first page.
ps
Page size. Specifies the number of entries to return per page. The default value is 10. The maximum value you can specify is 50.
type
Filters the bookmarks returned in the feed. You can filter by the following values:
popular
Returns a list of the most bookmarked web sites. This value is the default value.
visited
Returns a list of the bookmarks that are accessed most often.


Example


You can add code similar to the HTML used in this example to display the popular bookmarks returned by either the /snippet/popular or /lisnippet/popular resource in a web page.

<iframe src="http://yourcompany.com/dogear/lisnippet/popular?lang=en">

	<p>Your browser does not support iframes.</p>

	</iframe>


You can change the style of bookmarks returned by the /snippet/popular resource by applying a style defined in the cascading style sheet to them.

<div class="dogearlinks">

	<div class="dogearlink">

	<a href="http://sampleurl.com/" title="Description of URL">"Title of URL"</a>

	<br />

	<span class="dogearperson">Firstname&nbsp;Lastname</span>

	<span class="dogeartags">

	<a href="http://url.of.tag1">tag1</a>

	<a href="http://url.of.tag2">tag2</a>

	<a href="http://url.of.tag3">tag3</a>

	</span>

	</div>

	</div>


You can change the style of list of bookmarks returned by the /lisnippet/popular resource by applying a style defined in the cascading style sheet to it.

<div class="dogearlinks">

	<ul class="doglinks">

	<li class="doglink">

	<a href="http://sampleurl.com/" title="Description of URL">"Title of URL"</a>

	</li>

	<li>

	<ul class="dogdata">

	<li class="dogearauthor">

	<a href="http://url.of.person" title="url of person">"Person"</a></li>

	</li>

	<li class="dogeartags">

	<a href="http://url.of.tag1">tag1</a>

	<a href="http://url.of.tag2">tag2</a>

	</li>

	</ul>

	</li>

	</ul>

	</div>