By Donald Griswold on Saturday, 23 April 2016
Posted in Technical Issues
Replies 9
Likes 0
Views 378
Votes 0
I need some help knowing if this is possible and if you could help with this solution. We need the blog homepage category listed within the square to only display the parent or root category. I have attached an image that should show what I’m needing on the front end.

This is located on this page:
http://healthyplace.com/2015backup36/index.php?option=com_easyblog&view=latest&Itemid=231

If you go into the backend of the site in EasyBlog > Categories all blogs should already be in a parent category via a subcategory.

The file for the template that controls this page on the front end is located here.
components/com_easyblog/themes/origami/blogs/latest/default.main.php

The table “d1pcu_easyblog_category” with parent_id = 0 will show the parent categories.

What I"m needing:
A function like this on lines 132-135 of that default.main.php file should be what I need:
if “d1pcu_easyblog_category” parent_id=0 then echo only that “d1pcu_easyblog_category” title.

Thanks for your help.
You could edit the file /components/com_easyblog/themes/wireframe/blogs/latest/default.main.php and at line 124 replace the codes below,


<?php foreach ($post->categories as $category) { ?>
<span>
<a href="<?php echo $category->getPermalink();?>"><?php echo $category->getTitle();?></a>
</span>
<?php } ?>


With,


<?php foreach ($post->categories as $category) { ?>
<?php if (!$category->parent_id) { ?>
<span>
<a href="<?php echo $category->getPermalink();?>"><?php echo $category->getTitle();?></a>
</span>
<?php } ?>
<?php } ?>
·
Sunday, 24 April 2016 01:28
·
0 Likes
·
0 Votes
·
0 Comments
·
This is close but the titles are not there. I am also using the origami template. I just replaced the same code on that template.

Thanks
·
Monday, 25 April 2016 22:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Unfortunately our support does not cover customization, I am not too sure how your category structure is but based on the codes provided above, it should only display parent categories.
·
Tuesday, 26 April 2016 00:23
·
0 Likes
·
0 Votes
·
0 Comments
·
The category's were imported from wordpress. Then I created my own main categories and put the imported categories under the categories I created.
·
Tuesday, 26 April 2016 03:46
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Donald,

I'm sorry but this is considered customization and it is out of our support scope. I can't assist you any further.
·
Tuesday, 26 April 2016 10:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Is there a customization fee i could pay to have this done?
·
Friday, 29 April 2016 01:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Donald,

I am really sorry but we are actually quite tied up with our own internal development Easydiscuss 4 and Easysocial 2.0 and we wouldn't be able to assist you with these customizations right now

Thanks for understand.
·
Friday, 29 April 2016 11:47
·
0 Likes
·
0 Votes
·
0 Comments
·
The above code did work! I needed to place the items into the parent category as well as the sub category.

Thanks!
·
Wednesday, 04 May 2016 01:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Donald,

Glad to hear that.
·
Wednesday, 04 May 2016 09:52
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post