using the rating system to rate a page from a different one
Forum » Help / Editing pages » using the rating system to rate a page from a different one
Started by: wstonewstone
On: 1245267863|%e %b %Y, %H:%M %Z|agohover
Number of posts: 5
rss icon RSS: New posts
Summary:
is this possible?
using the rating system to rate a page from a different one
wstonewstone 1245267863|%e %b %Y, %H:%M %Z|agohover

Hi,
I am trying to set-up a list of names with the +/-rating next to each name.
See: http://bigbrotheruk.wikidot.com/bb10:housemates

I'd prefer it if visitors could just click the +/- next to each name rather than having to visit the individual pages.

Can this be done?

Thanks.

Re: using the rating system to rate a page from a different one
David MarseillesDavid Marseilles 1245280284|%e %b %Y, %H:%M %Z|agohover

I don't know. And I can't see your wikidot source so I'll have to explain my best guess method from scratch, but what I'd do is use the ListPages module for the names list, like so:

[[module ListPages category="bb10"]]
%%linked_title%% (%%rating%%) %%content{x}%%
[[/module]]

Where x is the section you keep the rating module on the contestant pages. To make sections on those pages, you'll need to use a divider made up of four equal signs ====. If the only divider you have is between the rest of the page and the rating module, then it will be %%content{2}%%. For more information on dividers in templates, check out the template section of wikidot documentation.

Will that module successfully rate the page it's grabbed off of? Will it work at all? Might accidentally rate the page the listpages module is on instead (I'm sure that is what would happen if you used [[include]] instead of listpages)? I don't know. Tell me what happens.

Re: using the rating system to rate a page from a different one
wstonewstone 1245321263|%e %b %Y, %H:%M %Z|agohover

Hi, there should be no reason you can't see the source: it's open to all wikidot members (although I have moved the page options to the top!).

The "include" method didn't work, unfortunately, as it did what you suspected and rated the page it was on :-s

I will give the listpages method a go in a bit and let you know.

Re: using the rating system to rate a page from a different one
wstonewstone 1245322169|%e %b %Y, %H:%M %Z|agohover

Ok, tried out the listpages method. It just displays the raw text [[module rate]] :-(

Re: using the rating system to rate a page from a different one
RobElliottRobElliott 1245344882|%e %b %Y, %H:%M %Z|agohover

There is a method you can use with an external widget which does what you want and allows you to rate either on the original page or in a table on a different page. This uses the ratings code from JS-Kit at http://www.js-kit.com

Once you've signed up (free) and told it which site you want to apply the ratings code on it gives you some div and script code which you put inside an html codeblock on the page where you want your rating. Change the title= to uniq= and give it a unique name. In this case I've given it the page name but it could be anything as long as it's unique.

For this example we've added the code to a page called support:javascript:

[!--
[[code type="HTML"]]
<html>
<body>
<div class="js-kit-rating" uniq="support:javascript" permalink=""></div>
<script src="http://js-kit.com/for/strathviewconsultants.wikidot.com/ratings.js"></script>

</body>
</html>
[[/code]]
--]

As usual you must then refer to that codeblock in an iframe. So underneath the codeblock add:

[[iframe http://strathviewconsultants.wikidot.com/support:javascript/code/3 frameborder="0" scrolling="no" width="200px" height="40px"]]

(the codeblock was the third one on that page, hence the /code/3).

This will put the rating on the page like this:

Do that with your other pages where you want the rating.

But on another page you can put all the ratings together by using a table and adding in the iframes, like this:

||~ Page ||~ Rate it ||
|| [*http://strathviewconsultants.wikidot.com/support:pages Support:Pages] || [[iframe http://strathviewconsultants.wikidot.com/support:pages/code/1 width="25%" height="40px" frameborder="0" scrolling="no"]] ||
|| [*http://strathviewconsultants.wikidot.com/support:javascript Support:Javascript] ||[[iframe http://strathviewconsultants.wikidot.com/support:javascript/code/3 frameborder="0" scrolling="no" width="25%" height="40px"]] ||
|| [*http://strathviewconsultants.wikidot.com/support:network Support:Network] ||[[iframe http://strathviewconsultants.wikidot.com/support:network/code/6 frameborder="0" scrolling="no" width="25%" height="40px"]] ||

This gives you:

Page Rate it
Support:Pages
Support:Javascript
Support:Network

Your users can then either rate your pages (or whatever it is on your pages you want to rate) from this table or from the original page. And if you make the text a link as I have they can go straight to the page if they want to. I've used external links here as I'm linking from the comubnity site. Normally you would use standard [[[page]]] links. The advantage with the js-kit method though is that it allows you to pull in ratings into a table from multiple sites if you want.


Warning
As admin you would need to make the first rating and while you are testing it you must keep clearing your cookies before you do each subsequent rating because otherwise it doesn't register the rating. It is a mechanism designed to reduce the chance of multiple ratings by a single user.


It is also possible to have a table of top posts but I have so far not got that to work well, probably because I keep changing the unique name. Anyway, that table is also on my page support:javascript if you want to have a look.

It is probably overkill and is certainly a bit fiddly. So although it works I hope someone gives you a solution using native wikidot syntax.

Edit: By the way I'm not expecting anyone to rate those pages, the ratings are there purely as an example of the method.

Rob


ad5.png
last edited on 1245397589|%e %b %Y, %H:%M %Z|agohover by RobElliott + show more
New post

Bookmark and Share

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.