Difference between revisions of "Member Favorites"

From TMM Wiki
Jump to navigationJump to search
 
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
{{CARMA1 Manual
 
{{CARMA1 Manual
| show_skins_and_templates_section = true
+
| show_templates_admin_section = true
 
}}
 
}}
  
CARMA 1.3.1.0 lets members mark videos, photos, actors, or custom tags as favorites and access them through two new template functions: [[carma_favorite]] and [[carma_list_favorites]].
+
As of [[CARMA]] 1.3.1.0, [[Ct#Member|members]] can use template functions which let them mark favorites in your [[Ct#Site|site(s)]]. These favorites can be videos, photos, actors, or custom tags.
 
 
== Listing Favorites ==
 
''carma_list_favorites'' prints a member's favorite content. You can output all favorite content or select only a single favorite type. By default, the output of this folder is controlled by the template list
 
 
 
=== Examples ===
 
* To output all member's favorites:
 
{carma_list_favorites}
 
* To output all content favorites (video and photo sets):
 
{carma_list_favorites get='gals'}
 
* To output all photo set favorites:
 
{carma_list_favorites get='gals' type='gal'}
 
* To output all video set favorites:
 
{carma_list_favorites get='gals' type='video'}
 
* To output all actor favorites:
 
{carma_list_favorites get='actors'}
 
* To output all custom favorites:
 
{carma_list_favorites get='custom'}
 
* To output all custom favorites with section tag of clips:
 
{carma_list_favorites get='custom' section_name='clips'}
 
  
 +
The two template functions that allow members to mark favorites are [[carma_favorite]] and [[carma_list_favorites]]. These functions can only be used in [[CARMA]] 1.3.1.0 or higher; if you cannot access these templates, please [http://clients.toomuchmedia.com submit an upgrade ticket] for your [[CARMA]] install.
  
 
== Add/Removing Favorites ==
 
== Add/Removing Favorites ==
Mark content as a favorite template function ''carma_favorite''. This outputs a link that either adds or deletes this content to their favorites. By default, this function uses the template ''favorite'' for its output.  
+
The ''carma_favorite'' template function allows [[Ct#Member|members]] to mark content as a favorite, outputting a link that allows them to either add or delete the selected content to/from their favorites. This function uses the ''favorite'' template for its output by default.
  
 
=== Examples ===
 
=== Examples ===
 
For favorite videos and photos:
 
For favorite videos and photos:
* {carma_favorite galid=$galid}
+
<pre>{carma_favorite galid=$galid}
* {carma_favorite galid=$smarty.request.galid}
+
{carma_favorite galid=$smarty.request.galid}
* {carma_favorite galid=42}
+
{carma_favorite galid=42}</pre>
  
 
For favorite actor:
 
For favorite actor:
* {carma_favorite actorid=11}
+
<pre>{carma_favorite actorid=11}</pre>
  
 
To create a custom favorite:
 
To create a custom favorite:
* {carma_favorite section_name=”fav_type” caption=”title” data=”anything you want here”}
+
<pre>{carma_favorite section_name=”fav_type” caption=”title” data=”anything you want here”}</pre>
 +
 
 +
The ''section_name'' and ''caption'' fields are required in order to use custom favorites. The ''data'' field can be set to any [[Smarty]] variable.
  
The fields ''section_name'' and ''caption'' are required for custom favorites. The field, ''data'', can be any [[Smarty]] variable; for example: if you want to bookmark a page, you can set ''data'' to the page's URL and set ''caption'' to page's title. Section differs for each group of favorites you're tracking; for example: you can have a section for 'clips' and a section for 'photos', and then track the each member's favorite clips and the favorite photos separately.  
+
For example: if you want to bookmark a page, you can set the ''data'' field to that page's URL and set ''caption'' to the page's title. The value for ''section_name'' differs for each group of favorites you're tracking. For example, you can have separate sections for ''clips'' and for ''photos'', allowing you to track each [[Ct#Member|member's]] favorite clips separately from their favorite photos.
  
 
To bookmark the current page:
 
To bookmark the current page:
Line 50: Line 34:
 
</pre>
 
</pre>
  
You can also use the code above to create a list of a member's favorite video clips (instead of making the entire video set a favorite).
+
You can also use the sample code above to create a list of all video clips a [[Ct#Member|member]] has saved to favorites, instead of making the entire video set a favorite list.
 +
 
 +
== Listing Favorites ==
 +
The ''carma_list_favorites'' function allows you to display a chosen [[Ct#Member|member's]] favorite content. You can use this function to output all content set to favorites by the member, or to output only a single favorite type (for example, videos, photos, etc). The output of this folder is controlled by the template list by default.
 +
 
 +
=== Examples ===
 +
To output all member's favorites:
 +
<pre>{carma_list_favorites}</pre>
 +
To output all content favorites (video and photo sets):
 +
<pre>{carma_list_favorites get='gals'}</pre>
 +
To output all photo set favorites:
 +
<pre>{carma_list_favorites get='gals' type='gal'}</pre>
 +
To output all video set favorites:
 +
<pre>{carma_list_favorites get='gals' type='video'}</pre>
 +
To output all actor favorites:
 +
<pre>{carma_list_favorites get='actors'}</pre>
 +
To output all custom favorites:
 +
<pre>{carma_list_favorites get='custom'}</pre>
 +
To output all custom favorites with section tag of clips:
 +
<pre>{carma_list_favorites get='custom' section_name='clips'}</pre>
 +
 
  
 
== See Also ==
 
== See Also ==

Latest revision as of 16:29, 1 October 2010

CARMA
Templates Admin
Members Area Templates
Tour Templates
Member Favorites
Smarty Loops
Smarty Caching
Smarty print array
Base Templates
User Variables
Rating System

As of CARMA 1.3.1.0, members can use template functions which let them mark favorites in your site(s). These favorites can be videos, photos, actors, or custom tags.

The two template functions that allow members to mark favorites are carma_favorite and carma_list_favorites. These functions can only be used in CARMA 1.3.1.0 or higher; if you cannot access these templates, please submit an upgrade ticket for your CARMA install.

Add/Removing Favorites

The carma_favorite template function allows members to mark content as a favorite, outputting a link that allows them to either add or delete the selected content to/from their favorites. This function uses the favorite template for its output by default.

Examples

For favorite videos and photos:

{carma_favorite galid=$galid}
{carma_favorite galid=$smarty.request.galid}
{carma_favorite galid=42}

For favorite actor:

{carma_favorite actorid=11}

To create a custom favorite:

{carma_favorite section_name=”fav_type” caption=”title” data=”anything you want here”}

The section_name and caption fields are required in order to use custom favorites. The data field can be set to any Smarty variable.

For example: if you want to bookmark a page, you can set the data field to that page's URL and set caption to the page's title. The value for section_name differs for each group of favorites you're tracking. For example, you can have separate sections for clips and for photos, allowing you to track each member's favorite clips separately from their favorite photos.

To bookmark the current page:

{capture name=link}
http://{$smarty.server.HTTP_HOST}{rebuild_link encode=1}
{/capture}
{carma_favorite section_name='clips' caption=$filename data=$smarty.capture.link}

You can also use the sample code above to create a list of all video clips a member has saved to favorites, instead of making the entire video set a favorite list.

Listing Favorites

The carma_list_favorites function allows you to display a chosen member's favorite content. You can use this function to output all content set to favorites by the member, or to output only a single favorite type (for example, videos, photos, etc). The output of this folder is controlled by the template list by default.

Examples

To output all member's favorites:

{carma_list_favorites}

To output all content favorites (video and photo sets):

{carma_list_favorites get='gals'}

To output all photo set favorites:

{carma_list_favorites get='gals' type='gal'}

To output all video set favorites:

{carma_list_favorites get='gals' type='video'}

To output all actor favorites:

{carma_list_favorites get='actors'}

To output all custom favorites:

{carma_list_favorites get='custom'}

To output all custom favorites with section tag of clips:

{carma_list_favorites get='custom' section_name='clips'}


See Also

For more information on the available parameters for these two template functions, please refer to the following articles: