inherit
Head of the Emu Preservation
Head of the Emu Farmers Association
13398
0
Jul 12, 2020 14:15:37 GMT -8
Joshua Farrell
7,966
September 2003
dentist
|
Post by Joshua Farrell on Apr 6, 2015 13:27:12 GMT -8
So, I thought this was posted previously somewhere on the forum, but I can't seem to find the code. What code do you need in order to display coding (like an image, or a text url) after the first post of a thread, and only the first post, and not after every post in the thread?
|
|
inherit
Head of the Emu Preservation
Head of the Emu Farmers Association
13398
0
Jul 12, 2020 14:15:37 GMT -8
Joshua Farrell
7,966
September 2003
dentist
|
Post by Joshua Farrell on Apr 7, 2015 16:30:41 GMT -8
Still looking for help.
Basically I want to be able to display various text, images and links (and probably java script too, if I have something that requires java script) after the first post, without having the issue of the text showing up after every single post.
|
|
Kami
Forum Cat
Posts: 40,199
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,199
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 7, 2015 17:47:56 GMT -8
Still looking for help. Basically I want to be able to display various text, images and links (and probably java script too, if I have something that requires java script) after the first post, without having the issue of the text showing up after every single post. Do you have an example of what you are talking about?
The part that's tripping me up is the bit about having HTML after the first post, rather than in the first post. What exactly would the subsequent posts be? Is it something like, you specify the HTML in the opening post, and subsequent posts would then look like the HTML you specified?
Also I'm nearly positive there's no way to allow for javascript in a post for security reasons, but you'd have to ask in the support board for that.
|
|
inherit
Head of the Emu Preservation
Head of the Emu Farmers Association
13398
0
Jul 12, 2020 14:15:37 GMT -8
Joshua Farrell
7,966
September 2003
dentist
|
Post by Joshua Farrell on Apr 7, 2015 18:50:29 GMT -8
No, it wouldn't be in the first post, it would be inbetween the first and second post. Here is an example: awesomescreenshot.com/0974sqqkeb . It is the section that is labeled as "Sponsor Ads". Basically I want to be able to do that, but have any html there, instead of just an ad like they are using. Pretty much I want to be able to add a box inbetween the first and second post, so that I can have information there that would be used for members to reference while posting. The issue is when I edit the topic template page to include even a <div> or a <table>, it shows up after every single post, and not the first post, because all posts are formatted the same way, and there is nothing there to tell a <div> or <table> to only show up after a certain post.
|
|
Kami
Forum Cat
Posts: 40,199
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,199
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Apr 7, 2015 23:37:26 GMT -8
No, it wouldn't be in the first post, it would be inbetween the first and second post. Here is an example: awesomescreenshot.com/0974sqqkeb . It is the section that is labeled as "Sponsor Ads". Basically I want to be able to do that, but have any html there, instead of just an ad like they are using. Pretty much I want to be able to add a box inbetween the first and second post, so that I can have information there that would be used for members to reference while posting. The issue is when I edit the topic template page to include even a <div> or a <table>, it shows up after every single post, and not the first post, because all posts are formatted the same way, and there is nothing there to tell a <div> or <table> to only show up after a certain post. Ahh, I see what you mean. I think there is a way to specify the first post with an if statement, but I'm not entirely sure how. Maybe David Clark might know?
|
|
inherit
The Great Cinnamon Roll
191518
0
Oct 19, 2016 22:17:44 GMT -8
David Clark
Care for some tai chi with your chai tea?
17,602
March 2013
davidlinc1
|
Post by David Clark on Apr 9, 2015 8:55:13 GMT -8
If you go to Admin > Structure > Layout Templates and go into the Thread template, you can click on the Post List tab to go to that template. You should see that the template begins with a {foreach} loop, producing each post. At the bottom of that template, you'll see that the foreach loop ends with a {/foreach} tag -- make a new line above that and paste this there:
That should produce the effect you're looking for, creating a bot post after every first post with the content you specify in the area highlighted in red above. Example:
|
|
inherit
Head of the Emu Preservation
Head of the Emu Farmers Association
13398
0
Jul 12, 2020 14:15:37 GMT -8
Joshua Farrell
7,966
September 2003
dentist
|
Post by Joshua Farrell on Apr 9, 2015 18:41:42 GMT -8
Thank you David! Exactly what I was looking for!
|
|