solved blog categories

CentricBeats
CentricBeats
@centricbeats
9 years ago
0 posts
trying to create a categories section on the site_blogs page.
so i create a blog category and a blog category row tpl with no luck.

is this the right to approach this?
updated by @centricbeats: 03/23/16 07:38:58AM
douglas
@douglas
9 years ago
2,793 posts
Which skin are you using?


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
CentricBeats
CentricBeats
@centricbeats
9 years ago
0 posts
Im using the Media Pro skin (light) that i renamed xxSite
michael
@michael
9 years ago
7,746 posts
Seams like the right approach. Also use the group_by clause to get just one of each:


"{jrCore_list}"
http://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list
douglas
@douglas
9 years ago
2,793 posts
Here is one way, if you want the categories on the same page as site_blogs... in your site_blogs.tpl, add this:

<div class="block">
    <div class="title">
        <h2>Categories</h2>
    </div>
    <div class="block_content">
        <div class="item p5">
            {capture name="blog_category_template" assign="blog_category_row"}
                {literal}
                     {if isset($_items)}
                         {foreach $_items as $item}
                             <a href="{$jamroom_url}/site_blogs/category/{$item.blog_category_url}" class="media_title">{$item.blog_category|replace:"_":" "}</a>{if !$item@last}&nbsp;-&nbsp;{/if}
                         {/foreach}
                     {/if}
                 {/literal}
             {/capture}
             {jrCore_list module="jrBlog" order_by=$order_by group_by="blog_category" template=$blog_category_row search1="blog_category not_in about,news,welcome,latest,featured,exclusive"}
         </div>
     </div>
</div>

just below this line:

<div class="col9">

then change the jrCore_list function from this:

{jrCore_list module="jrBlog" order_by=$order_by template="site_blogs_list.tpl" search1="blog_category not_in about,news,welcome,latest,featured,exclusive" pagebreak=$_conf.jrMediaProLight_default_pagebreak page=$_post.p}

to this:

{if isset($_post.option) && $_post.option == 'category' && isset($_post._1)}
    {jrCore_list module="jrBlog" order_by=$order_by template="site_blogs_list.tpl" search1="blog_category_url = `$_post._1`" pagebreak=$_conf.jrMediaProLight_default_pagebreak page=$_post.p}
{else}
    {jrCore_list module="jrBlog" order_by=$order_by template="site_blogs_list.tpl" search1="blog_category not_in about,news,welcome,latest,featured,exclusive" pagebreak=$_conf.jrMediaProLight_default_pagebreak page=$_post.p}
{/if}



--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
CentricBeats
CentricBeats
@centricbeats
9 years ago
0 posts
wow. thanks i will apply it shortly and reply back to this thread
CentricBeats
CentricBeats
@centricbeats
9 years ago
0 posts
Thanks just what i was looking for
douglas
@douglas
9 years ago
2,793 posts
Your welcome!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

Tags