same templates used diferent results based on smarty calls (only diference was cloning)

soaringeagle
@soaringeagle
5 years ago
3,304 posts
hi guys
ok this 1 is confusing
1st off i use sitebuilder
on www.dreadlockssite.com front page 1/2 way down theres the forums lists
random featured only shows the title and excerpt from 1st post..as it should be and as the latest forum post shows
random all forum posts shows some post titles and excerpts and some reply comment excepts!

front page codes
latest
{jrCore_list module="jrForum" order_by="forum_updated desc" search="forum_profile_id = 13827" limit="10" template="my_forum_list.tpl"}
random featured
{jrCore_list module="jrForum" order_by="forum_updated random" search1="forum_profile_id = 13827" search2="forum_featured = on" limit="10" template="my_forum_list.tpl"}

and random non featured
IMPORTANT NOTE - i cloned featured random and simply removed featured from title and featured search from code
{jrCore_list module="jrForum" order_by="forum_updated random" search1="forum_profile_id = 13827" limit="10" template="my_forum_list.tpl"}

and my custom template code
{jrCore_module_url module="jrForum" assign="murl"}
<div>
    {foreach from=$_items item="item"}
    <div class="frontpageforumpost" style="overflow:hidden;margin-bottom:12px">
        <div style="float:left;padding-right:12px;">
            {jrCore_module_function function="jrImage_display" module="jrUser" type="user_image" item_id=$item._user_id size="xsmall" alt=$item.user_name class="action_item_user_img iloutline"}
        </div>
        <div>
            {if $item.forum_pinned == 'on'}
                <h2><a href="{$jamroom_url}/dreadlocks-forums/forum/{$item.forum_cat_url}/{$item._item_id}/{$item.forum_title_url}">{$item.forum_title}</a></h2>
            {else}
                <h2><a href="{$jamroom_url}/dreadlocks-forums/forum/{$item.forum_cat_url}/{$item._item_id}/{$item.forum_title_url}">{$item.forum_title}</a></h2>
            {/if}
            <br><span class="normal"><small>{$item._created|jrCore_format_time}, by <a href="{$jamroom_url}/dreadlocks-forums/forum/{$item.forum_cat_url}">{$item.forum_cat}</a> </small></span><br><div class="forummainpagelisttext">{$item.forum_text|jrCore_strip_html|truncate:300}<p><br><div class="forumreadmore"> <div class="item"><a href="{$jamroom_url}/dreadlocks-forums/forum/{$item.forum_cat_url}/{$item._item_id}/{$item.forum_title_url}">read more</a></div><div class="item"> Replies {$item.forum_post_count}</div></div> </div>
        </div>
    </div>
    {/foreach}

</div>

so how can the 3rd call to the same template result in a diferent way of displaying the posts?

only thing diferent was the fact i cloned it, 1st time ever doing that


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities

updated by @soaringeagle: 05/11/19 12:40:18PM
SteveX
SteveX
@ultrajam
5 years ago
2,584 posts
Titles do appear on some of the posts under "Random All Dreadlocks Forums Discussions".

When I click a "read more" for one of those posts (with a title) I can read the article, But when I click a "read more" for one of those posts without a title I get a 404 Not Found.

So I would guess that the difference is with the posts, not the jrCore_list call or the template?


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
soaringeagle
@soaringeagle
5 years ago
3,304 posts
i think thats cause the ones withou titles..are replies to posts not the posts themselves but have not examine the urls for clues ill do that now


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
soaringeagle
@soaringeagle
5 years ago
3,304 posts
missing the page title portion of the url
https://www.dreadlockssite.com/dreadlocks-forums/forum//38842/

its something with the template code..or the call
but dunno how it acts diferent there


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
SteveX
SteveX
@ultrajam
5 years ago
2,584 posts
The 404 Not Found posts don't have a $item.forum_cat_url , or $item.forum_title_url , or $item.forum_title


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
5 years ago
2,584 posts
Or $item.forum_cat


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
5 years ago
2,584 posts
Put a debug in the template to see what the differences are.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
soaringeagle
@soaringeagle
5 years ago
3,304 posts
so...why not is the question of the hour haha

ive figured that out just dont understand the why
can u test it on a test site and try the cloning vs pasting in code b4 edit


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
soaringeagle
@soaringeagle
5 years ago
3,304 posts
ok 1 sec


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
soaringeagle
@soaringeagle
5 years ago
3,304 posts
(snipped)


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
soaringeagle
@soaringeagle
5 years ago
3,304 posts
i'm not seeing any diferences in the jrforums sections


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
SteveX
SteveX
@ultrajam
5 years ago
2,584 posts
Yes, as you can see, those variables are missing in the posts that are acting up.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
SteveX
SteveX
@ultrajam
5 years ago
2,584 posts
Search one of the problem posts for forum_cat in the debug you posted, it isn't there. You can try checking for it in the database as well, it probably won't be there either.


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
soaringeagle
@soaringeagle
5 years ago
3,304 posts
not sure the best way to find it without even knowing the post titles
but why is it even pulling in posts without thse these shouldnt be recognized as posts since i am pretty certain they are replies to posts, not posts themselves
if you read the excerpts they all seem to be replies


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
soaringeagle
@soaringeagle
5 years ago
3,304 posts
yea, every last 1 of those is replies
im thinking its a bug in the call or the cloning process, or who knows

this part of the template
  {if $item.forum_pinned == 'on'}
                <h2><a href="{$jamroom_url}/dreadlocks-forums/forum/{$item.forum_cat_url}/{$item._item_id}/{$item.forum_title_url}">{$item.forum_title}</a></h2>
            {else}
                <h2><a href="{$jamroom_url}/dreadlocks-forums/forum/{$item.forum_cat_url}/{$item._item_id}/{$item.forum_title_url}">{$item.forum_title}</a></h2>
            {/if}
seems entirely poinless as the if and else both do the same


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
SteveX
SteveX
@ultrajam
5 years ago
2,584 posts
soaringeagle:not sure the best way to find it without even knowing the post titles
You can find them by their id.
soaringeagle:im thinking its a bug in the call or the cloning process, or who knows
It's because the replies are different - they don't have titles pr categories so that information can't be displayed.

If you want to not show any of the items which don't have a title, you could try something along these lines:
search="forum_title not_like %_%"



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
soaringeagle
@soaringeagle
5 years ago
3,304 posts
ok i'll try that just not sure why its needed there but not elsewhere


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
soaringeagle
@soaringeagle
5 years ago
3,304 posts
caused a smarty error


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
soaringeagle
@soaringeagle
5 years ago
3,304 posts
temporarily just deleted the whole tab till i figure this out


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities
brian
@brian
5 years ago
10,148 posts
when you create a forum list, you must specifically get the forum TOPICS - not all entries, since most are going to be follow up entries ON a topic. You need to add an extra search condition:

{jrCore_list module="jrForum" order_by="forum_updated desc" search1="forum_profile_id = 13827" search2="forum_post_count > 0" limit="10" template="my_forum_list.tpl"}

Only topic leader posts have a "forum_post_count".


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
soaringeagle
@soaringeagle
5 years ago
3,304 posts
awesome thnx so umm... why does it work corrctly in the other 2 ..obviosly featured wukd work right because of featured on
but why does the latest not also list replies then ..

but thnx i knew youd know a solution


--
soaringeagle
head dreadhead at dreadlocks site
glider pilot student and member/volunteer coordinator with freedoms wings international soaring for people with disabilities

Tags