solved How To Truncate Using Site Builder Item List

derrickhand300
@derrickhand300
10 years ago
1,353 posts
I was wondering what the additional code would be to truncate this blog layout that i made using Item Lists in site Builder?

{jrCore_list module="jrBlog" search1="_profile_id = 1" order_by="_created desc" limit="3" group_by="_created" template="item_grid.tpl" tpl_dir="jrBlog"}

Would also be a great addition to the item list tool in site builder if possible.

What I am attempting to do is add a 'blog roll" to my main site page- but I dont want it to display the entire blog as its doing now...I would prefer a truncated version with a "Read More" link at the bottom

I would also like to know how to truncate this from the list_blog.tpl

<div class="normal">
                    {$item.blog_text|jrCore_format_string:$item.profile_quota_id|jrBlog_readmore}
                </div>

I have tried this but does not work for me

<div class="normal">
                    {$item.blog_text|jrCore_format_string:$item.profile_quota_id|jrCore_strip_html|truncate:150|jrBlog_readmore}
                </div>

Thanks
updated by @derrickhand300: 12/22/16 11:55:59AM
michael
@michael
10 years ago
7,816 posts
Then you would do that in your item_grid.tpl file. make a copy of that in your skin and remove the tpl_dir="jrBlog" so that it does use the one in the skin.

From there, the code your after is the same code thats in the lists, so check out the jrBlog item_list.tpl file to see how it is making the blog post get cut off. It will be a |something on the blog output variable.

so something like:
{$item.blog_text|jrBlog_readmore}
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Thanks Michael! I will give it a go now :)
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Michael- the best I can tell this is my jrBlog_item_list page
http://roughneckcity.com/roughneck-city/blog
If that's correct then its not getting cut off?
Here is what I have installed now...just looking for the |something that cuts off in item_list so I can move it to item_grid
http://roughneckcity.com/roughneck-city/blog
{jrCore_list module="jrBlog" search1="_profile_id = 1" order_by="_created desc" limit="1" group_by="_created" template="item_grid.tpl" }

updated by @derrickhand300: 08/07/15 09:02:07PM
michael
@michael
10 years ago
7,816 posts
item grid looks like it already has a jrBlog_readmore splitter in there. Check that your blog posts have the 'page break' button in the position your interested in.

In the tinymce editor when you are editing the blog post, the button looks like a dotted line with half a rectangle above and half below.
derrickhand300
@derrickhand300
10 years ago
1,353 posts
Ok just to let you know I'm still "TRYING" :)...I found this...
 <span class="normal">{jrCore_lang module="jrBlog" id="28" default="By"} {$item.user_name}, {$item.blog_publish_date|jrCore_format_time:false:"%F"}</span>
                    {$item.blog_text|jrCore_format_string:$item.profile_quota_id|jrBlog_readmore}
and will try changing it to this
 <span class="normal">{jrCore_lang module="jrBlog" id="28" default="By"} {$item.user_name}, {$item.blog_publish_date|jrCore_format_time:false:"%F"}</span>
                    {$item.blog_text|jrCore_format_string:$item.profile_quota_idjrCore_strip_html|truncate:150|jrBlog_readmore}
am I on the right track?
derrickhand300
@derrickhand300
10 years ago
1,353 posts
ok...thats almost got me there-its truncated now...I just have to clean it up- thanks Michael!
updated by @derrickhand300: 08/07/15 09:32:18PM

Tags