List all Participants on one page and forcing a "Wizard"-like Voting Process

1 year 4 months ago #692
Topic Author
PSW Group's Avatar
Posts: 9
List all Participants on one page and forcing a "Wizard"-like Voting Process

Dear Support,

I purchased the NorrCompetition component a while ago. While I was testing the component on a localhost machine, I need to display all the participants in all competitions on a single page, by skipping the "competitions" page straight to "participants". I have 13 competitions, and each competition contains 5 participants. How can I achieve this?

Another question: In the scenario I have, I want all the competitions to be linked to each other, like a wizard. The voter has to vote/complete all the 13 competitions in order to count the voting, else the voter has to restart the process from competition 1. How to achieve that too?

Awaiting your feedback.

Thank you,
Adel / PSW Group.

Last Edit: 1 year 4 months ago by PSW Group.

1 year 4 months ago #693
Eugene's Avatar
Posts: 488
List all Participants on one page and forcing a "Wizard"-like Voting Process

Hi Adel,

1. The most easiest way to meet this requirement is to insert Participants module in your article.
- Enable Load Modules content plugin.
- Add new article and insert {loadposition competitions1} tag there.
- Add Participants module and select custom position competitions1. There you can configure the module and set count per row and etc.
Select All competition in Competition param to display participants from all competitions. Don't forget to set correct value in Order option. E.g. Rating.
Here is the example:


Also you can create 13 copies of modules and select required category in each module and make list of competitions with participants.
- Create menu item related to this single page.

2. We are sorry, but NorrCompetition does not have such feature. It is custom task. You can add a topic to Suggestions & Wishlist or submit the task to Commercial Jobs section.


Like our extensions and support?
Add your voice to the JED listing with a 100 score review:: bit.ly/2ciJBqC
Thanks!
Attachments:

1 year 4 months ago #695
Topic Author
PSW Group's Avatar
Posts: 9
List all Participants on one page and forcing a "Wizard"-like Voting Process

Hi Eugene,

Thanks for your reply!

Your suggestion for the first part of the question works for me.

Regarding the second part, I implemented jQuery Steps ( www.jquery-steps.com/ ) to have a wizard/steps layout for the competitions.

Thanks again for your support!

1 year 4 months ago #697
Dmitry's Avatar
Posts: 653
List all Participants on one page and forcing a "Wizard"-like Voting Process

Hello!

Regarding the second part, I implemented jQuery Steps ( www.jquery-steps.com/ ) to have a wizard/steps layout for the competitions.


That's interesting. Can we see how does it look like?

Best regards,
Dmitry


Like our extensions and support?
Add your voice to the JED listing with a 100-score review: bit.ly/2ciJBqC
Thanks!

1 year 4 months ago #702
Topic Author
PSW Group's Avatar
Posts: 9
List all Participants on one page and forcing a "Wizard"-like Voting Process

Hi Dmitry,

That's interesting. Can we see how does it look like?


I will update this thread with the URL as soon as I get it online!

The most easiest way to meet this requirement is to insert Participants module in your article.


The module doesn't have a "Vote" button under each participant, like the component. How can I add the "Vote" button to the module's content without having to click on the participant to view the details and vote from the inside?

1 year 4 months ago #703
Dmitry's Avatar
Posts: 653
List all Participants on one page and forcing a "Wizard"-like Voting Process

The module doesn't have a "Vote" button under each participant, like the component. How can I add the "Vote" button to the module's content without having to click on the participant to view the details and vote from the inside?

This will require to rewrite the helper code, because vote button require additional vote data to implement the logic of vote (like period of vote, previous vote, max votes per competition/participant etc.)...

We can try to implement it, but not earlier then the end of march as we currently are working on other our extensions.

You can try to do it by yourself. Try this please:

In getList() method of helper.php inside foreach ($items as $item) add:
if ($params->get('participants_show_vote', 1))
{
	JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_competition/models', 'CompetitionModel');

	$participantModel = JModelLegacy::getInstance('Participant', 'CompetitionModel');
	$item->voteData = $participantModel->getVoteData($item->id, $item->competition_id);
}

In module template add JS loading:
CompetitionHelperAsset::load('competition.js', null, null, true);

And vote button code:
<?php if (isset($item->voteData)
	&& $params->get('participants_show_vote', 1)) : ?>
	<div class="nc-margin-small-bottom">
		<button
			id="nc-vote-button-<?php echo $item->id; ?>"
			<?php if ($item->voteData->canVote) : ?>
				onclick="Competition.voteInList('<?php echo $item->id; ?>', '<?php echo JSession::getFormToken(); ?>')"
			<?php endif; ?>
			<?php if (!$item->voteData->hasPermission) : ?>
				data-nc-tooltip title="<?php echo JText::_('COM_COMPETITION_VOTE_ERROR_NO_PERMISSIONS'); ?>"
			<?php endif; ?>
			<?php $buttonClass = $item->voteData->canVote ? "" : "active"; ?>
			type="button"
			class="btn hasTooltip nc-margin-small-top <?php echo $buttonClass; ?>">
			<?php if ($params->get('showRating', 1) && isset($item->votes)) : ?>
				<span class="icon-heart nc-text-red"></span>
				<span id="nc-votes-<?php echo $item->id; ?>"><?php echo $item->votes; ?></span>
			<?php endif; ?>
				<span class="nc-margin-small-left">
					<?php echo JText::_('COM_COMPETITION_TO_VOTE'); ?>
				</span>
		</button>
	</div>
<?php endif; ?>

Best regards,
Dmitry


Like our extensions and support?
Add your voice to the JED listing with a 100-score review: bit.ly/2ciJBqC
Thanks!

1 year 4 months ago #706
Topic Author
PSW Group's Avatar
Posts: 9
List all Participants on one page and forcing a "Wizard"-like Voting Process

Hi Dmitry and thanks for your response.

You can try to do it by yourself. Try this please:


I tried your suggestion, and now I'm receiving this (with error reporting is set to Dev):
Fatal error: Class 'CompetitionCompetition' not found in ...\components\com_competition\models\competition.php on line 382

Please advise!

Attachments:

1 year 4 months ago #707
Dmitry's Avatar
Posts: 653
List all Participants on one page and forcing a "Wizard"-like Voting Process

Try to add

JLoader::discover('Competition',  JPATH_SITE . '/components/com_competition/libraries');
after
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_competition/models', 'CompetitionModel');


Like our extensions and support?
Add your voice to the JED listing with a 100-score review: bit.ly/2ciJBqC
Thanks!

1 year 4 months ago #708
Topic Author
PSW Group's Avatar
Posts: 9
List all Participants on one page and forcing a "Wizard"-like Voting Process

Try to add

JLoader::discover('Competition',  JPATH_SITE . '/components/com_competition/libraries');
after
JModelLegacy::addIncludePath(JPATH_SITE . '/components/com_competition/models', 'CompetitionModel');


Now, the error is gone, the button shows under each participant, but the voting does not count in Admin > Components > NorrCompetition > Votes.

Any thoughts?

1 year 4 months ago #709
Dmitry's Avatar
Posts: 653
List all Participants on one page and forcing a "Wizard"-like Voting Process

What is in response? Open developer console in browser, network tab and there XHR requests. Try to vote and you should get the response like on attached image.


Like our extensions and support?
Add your voice to the JED listing with a 100-score review: bit.ly/2ciJBqC
Thanks!
Attachments:
Last Edit: 1 year 4 months ago by Dmitry.

You can get our help: Monday - Friday / 09:00 to 17:00 (GMT+2). but not limited. Our staff will be pleased to provide Premium support to every paid subscriber asap, but sometimes you should be ready to wait for our reply for up to 3 days. In case of free extensions we do the best to develop and maintain them either, but their support is not necessary.

Product Latest Update