Milk
New Member
Posts: 59
inherit
185504
0
Sept 22, 2021 13:14:00 GMT -8
Milk
59
November 2012
wolfmilk
|
Post by Milk on Jul 7, 2018 19:54:19 GMT -8
Forum URL: (private)
Hi there! I'm trying to remodel the Post List. Everything is working as in intended only for the first post, however. In subsequent posts, all of the $[post.created_by.... etc] variable have turned into numbers. I'm not sure how to fix this.
Can I please get some assistance?
P.S. The forum URL is currently private, so I'm happy to wait until office hours for a proboards staff member to respond.
|
|
Kami
Forum Cat
Posts: 40,201
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,201
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 7, 2018 20:21:52 GMT -8
Can you copy/paste what you have? Put it under spoiler tags if it's long (:
|
|
Milk
New Member
Posts: 59
inherit
185504
0
Sept 22, 2021 13:14:00 GMT -8
Milk
59
November 2012
wolfmilk
|
Post by Milk on Jul 8, 2018 1:39:05 GMT -8
Can you copy/paste what you have? Put it under spoiler tags if it's long (: Here's what I have in the Post List layout template. {foreach $[post]} <tr id="$[post.content_id]" class="$[post.content_class]{if $[post.even]} even{/if}{if $[viewing_recent_posts]} recent{/if}"> <td class="$[2post.unblocked_class]"> <table role="grid"> <tr> <td colspan="2"> <div class="content-head ui-helper-clearfix"> <div class="pl-floatleft"> <div class="pl-name"> <span class="material-icons">keyboard_arrow_right</span> <a href="$[post.created_by.href]" style="color:#$[post.created_by.group.color]" title="$[post.created_by.username]">$[post.created_by.name]</a> </div> <div class="normal-time"> $[post.created_on] {if $[post.how_posted]} via $[post.how_posted] {/if} {if $[post.edited]} (edited on $[post.edited.date] by $[post.edited.by_user]) {/if} </div> </div> <div class="post-list-right"> <div style="text-align:right"> <div class="controls quote-edit-like"> $[post.quote_button] $[post.edit_button] $[post.likes.button] $[post.select_options] </div> </div> <div class="info"> $[post.thread] $[post.likes] </div> </div> </div> </td> </tr> <tr> <td> <table> <tr> <td class="left-panel"> $[post.created_by.miniprofile] </td> <td class="content"> <article> <div class="message">$[post.message]</div> </article> </td> <td class="post-list-link"> {foreach $[post.created_by.custom_field]} {if $[post.created_by.custom_field.name] == "Plotter"} <a href="$[post.created_by.custom_field.value]" style="color:#$[post.created_by.group.color]" title="plotter" class="fas fa-address-card"></a> {/if} {/foreach} {foreach $[post.created_by.custom_field]} {if $[post.created_by.custom_field.name] == "Tracker"} <a href="$[post.created_by.custom_field.value]" style="color:#$[post.created_by.group.color]" title="tracker" class="fas fa-clipboard-list"></a> {/if} {/foreach} {foreach $[post.created_by.custom_field]} {if $[post.created_by.custom_field.name] == "Music"} <div class="player"> <div class="player-position"> <object width="500" height="50" data="http://flash-mp3-player.net/medias/player_mp3_mini.swf" type="application/x-shockwave-flash"> <param value="http://flash-mp3-player.net/medias/player_mp3_mini.swf" name="movie"> <param value="1f1f1f" name="bgcolor"><param value="mp3=$[post.created_by.custom_field.value]&bgcolor=1f1f1f&loadingcolor=aaaaaa&buttoncolor=$[post.created_by.group.color]&slidercolor=ffffff;" name="FlashVars"> </object> </div> </div> {/if} {/foreach} <a href="/user/$[post.created_by.id]/recent" style="color:#$[post.created_by.group.color]" title="recent posts" class="pe-7s-menu"></a> <a href="/user/$[post.created_by.id]/recent_threads" style="color:#$[post.created_by.group.color]" title="recent threads" class="pe-7s-albums"></a> </td> </tr> </table> </td> </tr> </table> </td> </tr> {/foreach}
|
|
#eb7100
1480
0
1
Nov 28, 2024 8:16:14 GMT -8
Craig
209,201
September 2001
cmdynasty
|
Post by Craig on Jul 8, 2018 6:40:06 GMT -8
That is strange. I copied it in to my theme, and it did not display the same behaviour. What do you have in the Thread template?
|
|
Milk
New Member
Posts: 59
inherit
185504
0
Sept 22, 2021 13:14:00 GMT -8
Milk
59
November 2012
wolfmilk
|
Post by Milk on Jul 8, 2018 15:01:19 GMT -8
That is strange. I copied it in to my theme, and it did not display the same behaviour. What do you have in the Thread template? I have this in the Thread template. <div class="container posts"> <div class="title-bar"> {if $[reply_button]} <ul class="controls"><li>$[reply_button]</li></ul> {/if} <h1>$[thread.subject]</h1> </div> <div class="control-bar ui-helper-clearfix $[scroll_class]"> $[search] <div class="controls"> $[action_menu] </div> <div class="float-left">$[thread.icons]</div> $[pagination] </div> <div class="content cap-bottom"> $[thread.labels] $[poll] <table class="list" role="presentation"> <tbody class="$[list_class]"> $[post_list] </tbody> </table> {if !$[quick_reply]}{if $[bottom_reply_button]} <div class="reply_button pad-all-double">$[bottom_reply_button]<br class="clear" /></div> {/if}{/if} </div> </div> $[quick_reply]
I also wanted to add that the $[post.created_by.group.color] variable doesn't seem to be working either.
|
|
#eb7100
33409
0
1
Nov 24, 2024 4:27:37 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Jul 9, 2018 12:42:28 GMT -8
Apologies for the late response. This was a bit of a doozy to figure out.
So what's happening here is when $[post.created_by.custom_field] is called upon as a foreach loop attempting to use any of its sibling variables inside the loop ends up nuking everything related to $[post.created_by] following the inclusion of that variable, even in the posts following the one that caused it.
For example, this loop alone produces the same effect as long as you have at least one custom field filled out in your profile:
I've submitted a bug report to our developers detailing this issue. In the meantime, if you get rid of $[post.created_by.group.color] in all three of your custom field loops it should fix the issue.
|
|
Milk
New Member
Posts: 59
inherit
185504
0
Sept 22, 2021 13:14:00 GMT -8
Milk
59
November 2012
wolfmilk
|
Post by Milk on Jul 9, 2018 16:09:40 GMT -8
Amazing as always, Proboards staff team. <3 Brian Thank you so much for your help! I removed the $[post.created_by.group.color] in all three of my custom field loops and it fixed the issue. I'll have to figure out a different way to get around that. 🤔 Thanks again!
|
|