Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
The Matrix: RateIt
#4
So long as there is a variable/function that calls the desired slug, you can use it on any content type.

For example, with i18n Special Pages, the function to call (assuming this is the actual page's slug, and not a custom/special field) would be:

PHP Code:
return_special_field('slug'

For search, it might be:

PHP Code:
$item->slug 

So to display it, simply use the appropriate slug-call (e.g. for special pages it is...):

PHP Code:
matrix_rateit(return_special_field('slug'), $showAverage$showTotal

Where $showAverage and $showTotal are booleans (true/false).

You can also prefix your slugs so that they are unique and don't clash with existing page slugs (this needs to be done before the first vote on that entry is cast). So for example, if used for blog entries, you may want to use:

PHP Code:
matrix_rateit('blog-'.return_special_field('slug')) 
Reply


Messages In This Thread
The Matrix: RateIt - by Angryboy - 2013-08-18, 20:42:10
RE: The Matrix: RateIt - by Oleg06 - 2013-08-18, 21:47:50
RE: The Matrix: RateIt - by Oleg06 - 2013-09-12, 06:25:59
RE: The Matrix: RateIt - by Angryboy - 2013-09-12, 21:21:17
RE: The Matrix: RateIt - by Oleg06 - 2013-09-12, 22:34:46
RE: The Matrix: RateIt - by Oleg06 - 2013-09-21, 19:17:11
RE: The Matrix: RateIt - by Oleg06 - 2013-09-21, 19:27:16
RE: The Matrix: RateIt - by 0zz - 2016-01-15, 01:54:29
RE: The Matrix: RateIt - by Riianna - 2016-08-26, 03:49:28



Users browsing this thread: 1 Guest(s)