Difference between revisions of "Member Favorites"
TMMStephenY (talk | contribs) |
|||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{CARMA1 Manual | {{CARMA1 Manual | ||
− | | | + | | show_templates_admin_section = true |
}} | }} | ||
− | CARMA 1.3.1.0 | + | 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. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | 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 == | ||
− | + | 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: | ||
− | + | <pre>{carma_favorite galid=$galid} | |
− | + | {carma_favorite galid=$smarty.request.galid} | |
− | + | {carma_favorite galid=42}</pre> | |
For favorite actor: | For favorite actor: | ||
− | + | <pre>{carma_favorite actorid=11}</pre> | |
To create a custom favorite: | To create a custom favorite: | ||
− | + | <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. | ||
− | + | 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 | + | 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 15:29, 1 October 2010
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: