-
AuthorPosts
-
jooservices Friend
jooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 19, 2011 at 3:21 am #167568Ref this source post: http://www.joomlart.com/forums/topic/k2-category-in-ja_bulletin/
I’ve patched this module to allow
– display K2 Categories
– link to K2 CategoriesUnzip
default.php will need copy to mod tmpl folder ( or override tmpl folder )
helper.php will need copy to module folderThank you
Viet Vu
August 19, 2011 at 4:39 am #406994I have replace the files. The k2 categories shows normaly but with no link.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 19, 2011 at 4:44 am #406996Hi there,
Please make sure default.php copied into template override if you have.
With Teline IV it would be:
templates/ja_teline_iv/html/mod_jabulletin
I’ve added code like this
<?php
if ( isset($item->categoryname)) {
echo '<a href="'. $item->categorylink.'">'.$item->categoryname.'</a>';
}?>
In helper.php i’ve added code like this
if ($using_mode == "com_k2") {
$lists [$i]->link = urldecode ( JRoute::_ ( K2HelperRoute::getItemRoute ( $row->id . ':' . urlencode ( $row->alias ), $row->catid . ':' . urlencode ( $row->categoryalias ) ) ) );
require_once (JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'route.php');
require_once (JPATH_SITE . DS . 'components' . DS . 'com_k2' . DS . 'helpers' . DS . 'utilities.php');
$categoryLink = urldecode ( JRoute::_ ( K2HelperRoute::getCategoryRoute ( $row->catid . ':' . urlencode ( $row->categoryalias ) ) ) );
$lists [$i]->categoryname = isset ( $row->categoryname ) ? $row->categoryname : "";
$lists [$i]->categorylink = $categoryLink;
} else {It should work with this 🙂
Thank you
Viet Vu1 user says Thank You to jooservices for this useful post
August 19, 2011 at 7:39 am #407025OK i was place default.php in wrong place. everything its ok now. i think the next release of ja_bulletin it must have this option in backend.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 19, 2011 at 7:47 am #407027Hi
I’ve forwarded this suggestion to developer team 🙂
Thank you
Viet VuAugust 22, 2011 at 4:44 am #407544Hello again
Two questions.
(a) Now the code above displays k2 subcatecory. If i want to display the root k2 categorys what i have to do ?
ex.
Football (root catecory) – this i want to display
– Subcategory 1
– Subcategory 2
– Subcategory 2Voley (root catecory) — this i want to display
– Subcategory 1
– Subcategory 2
– Subcategory 2(b) How can the format of k2 catecory is the same with the date in the left. small font and grey ?
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 22, 2011 at 4:55 am #407547ok i will wait.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 23, 2011 at 2:51 am #407784Hi there,
This’s another patch allow display K2 Category as pathway.
In helper.php i’ve added these codes:
$lists [$i]->k2Pathway = $this->getK2Pathway ( $row->catid, true );
and function
function getK2Pathway($cid, $reset = false) {
static $pathWay;
if ($reset)
$pathWay = array ();
$db = & JFactory::getDBO ();$query = ' SELECT * FROM #__k2_categories WHERE id = ' . ( int ) $cid;
$db->setQuery ( $query );
$result = $db->loadObject ();
$result->link = urldecode ( JRoute::_ ( K2HelperRoute::getCategoryRoute ( $result->id . ':' . urlencode ( $result->alias ) ) ) );
$pathWay [] = $result;if ($result->parent > 0)
$this->getK2Pathway ( $result->parent );
return $pathWay;
}
and in template.php
<?php
if (isset ( $item->k2Pathway )) {
$pathWays = array_reverse ( $item->k2Pathway );$index = 0;
foreach ( $pathWays as $pathWay ) {
$html = '<a class="joopathway" href="' . $pathWay->link . '">' . $pathWay->name . '</a>';
if ( $index == 0 ) {
$html = '<strong>' . $html . '</strong>';
}
if ( $index < count($pathWays)-1 )
$html .= ' - ';
echo $html;
$index ++;
}
}
?>Please note this patch will override above patched by using pathway instead a category.
Note: for stylesheet i’ve added classname .joopathway.
If you need use it, please add
.joopathway {}
and update with your own css.
Thank you
Viet Vu
1 user says Thank You to jooservices for this useful post
August 23, 2011 at 4:31 am #407803Please tell me the exact directory where each file must be placed.
OK everything its ok. thanks a lot. i believe in next version of ja_bulletin all this will included in the backend.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
August 23, 2011 at 8:53 am #407832Hi,
I’ll foward this patch to dev for take look 🙂
Thank you
Viet Vu -
AuthorPosts
This topic contains 11 replies, has 2 voices, and was last updated by jooservices 13 years, 4 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum