Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Use Ariquiz plugin in K2 Extrafield
(1 viewing) (1) Guest
component
Go to bottomPage: 1
TOPIC: Use Ariquiz plugin in K2 Extrafield
#44698
Use Ariquiz plugin in K2 Extrafield 10 Years, 9 Months ago Karma: 0
Hello

We are creating a math site with K2 (for written lessons and video lessons) and ariquiz (for live test of course)

so we thing we can embeed related quiz in K2 article. But writing the ariquiz content plugin sniplet again and again for all articles was not easy ( at least for me). So I created an extrafield in K2 and assign it to related categories.

I copied default template of K2 and renamed it default2(assign it to kategories) and put it in
/templates/"templatename"/html/com_k2/templates/default2
opened the item.php
find the extrafield portion and
replace it all with the code below

So in every lesson(K2 item) I only write the ID of Quiz to extrafiled and plugin does the rest. Thanks for the plugin again.

Code:




  
<!-- Item extra fields -->
<div class="itemExtraFields"  >
 <h3><?php echo JText::_('Quiz about this lesson :'); ?></h3>
  
  
<?php  
//convertArray to use ids as key
$extrafields = array();
foreach($this->item->extra_fields as $item)
{    
$extrafields[$item->id] = $item->value;
}   
?>    

<?php if(isset($extrafields[1]) === true):?>
<div style="text-align:center;">
{ariquizanywhere quizId="<?php echo $extrafields[1];?>"}{/ariquizanywhere} 

</div>
<?php else: ?>
<?php echo "NO QUIZ YET"; ?> 

<?php endif; ?>

<div class="clr"></div>
</div>

Last Edit: 2013/09/26 07:41 By angelaus.
The administrator has disabled public write access.
 
Go to topPage: 1