I want to display the Content Vote form in a specific position of my joomla article, so I can't use the Content - Vote standard plugin because it's set to be displayed before the article body (I need something more flexible).
So I decided to take the form code from the Content - vote plugin and put them in my template com_content/article override .
Here is the code :
<?php $uri = JUri::getInstance();
$uri->setQuery($uri->getQuery() . '&hitcount=0');?>
<form method="post" action="<?php echo htmlspecialchars($uri->toString()); ?>" class="form-inline">
<select name="user_rating">
<option value="1">Vote 1</option>
<option value="2">Vote 2</option>
<option value="3">Vote 3</option>
<option value="4">Vote 4</option>
<option value="5" selected="selected">Vote 5</option>
</select>
<input class="btn btn-primary" type="submit" name="submit_vote" value="Vote Now" />
<input type="hidden" name="task" value="article.vote" />
<input type="hidden" name="hitcount" value="0" />
<input type="hidden" name="url" value="<?php echo htmlspecialchars($uri->toString()); ?>" />
<?php echo JHtml::_('form.token') ?>
</form>
The code above is working good but my question, is it a good practice to embed that form directly to com_content override? Or do you have any other solution for a flexible Content - Vote function position for my article? Thanks