inherit
151650
0
Jul 29, 2018 18:13:48 GMT -8
• Ambrose •
1,077
February 2010
shoggard3
|
Post by • Ambrose • on Jun 27, 2019 9:33:08 GMT -8
To catch up, here's the original thread; support.proboards.com/thread/657593/default-post-templateI want to use the template I made as the default post template for everyone to use in the IC boards. How can I put my exact template in there without any issues? When I used his code, it put my template into his template, so it did work but not as perfectly as I would like. I tried adding in my own classes and that just broke the template apart so to speak.
|
|
Kami
Forum Cat
Posts: 40,037
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,037
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jun 27, 2019 15:42:33 GMT -8
This is totally possible, but with some template tweaking. Do you mind showing us what you have so we can see what you've tried?
|
|
inherit
151650
0
Jul 29, 2018 18:13:48 GMT -8
• Ambrose •
1,077
February 2010
shoggard3
|
Post by • Ambrose • on Jun 28, 2019 17:22:52 GMT -8
[newclass=".postdef"]width:400px;[/newclass] [newclass=".tag"]background-color: #343841; border-bottom:#f0f0f0; height:20px; line-height:20px; text-align:right; color:#fcfcfc; padding: 0 20px; font-family:Courier; font-size:12px; text-transform:lowercase;[/newclass] [newclass=".post"]background-color:#eaeaea; height:400px; line-height:20px; overflow:auto; font-family:Rajdhani; font-size:12px; padding:10px; text-align:justify;[/newclass] [newclass=".translate"]background-color:#343841; color:#fcfcfc; padding:5px; opacity:0; transition: opacity 1s ease; margin: 20px auto;[/newclass] [newclass=".translate:hover"]opacity:1;[/newclass]
<style> .posts .post .message { margin: auto; background-color: #eaeaea; width: 400px; height: 400px; line-height: 20px; overflow: auto; font-family: Rajdhani; font-size: 12px; padding: 10px; text-align: justify; }
.postdef {background-color: #343841; border-bottom:#f0f0f0; height:20px; line-height:20px; text-align:right; color:#fcfcfc; padding: 0 20px; font-family:Courier; font-size:12px; text-transform:lowercase;}
.tag {ackground-color: #343841; border-bottom:#f0f0f0; height:20px; line-height:20px; text-align:right; color:#fcfcfc; padding: 0 20px; font-family:Courier; font-size:12px; text-transform:lowercase;}
.post {background-color:#eaeaea; height:400px; line-height:20px; overflow:auto; font-family:Rajdhani; font-size:12px; padding:10px; text-align:justify;}
.translate {background-color:#343841; color:#fcfcfc; padding:5px; opacity:0; transition: opacity 1s ease; margin: 20px auto;}
.translate:hover {opacity:1;} </style>
As you can see, I tried adding the "newclass" tags to his code. It worked, to an extent. It technically broke the box apart. If you need more, just let me know! I did remove the [newclass] bits after I added them (after converting them to the CSS/HTML bit.)
|
|
Kami
Forum Cat
Posts: 40,037
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,037
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jun 29, 2019 16:02:27 GMT -8
So what I would recommend here would be to edit your post template HTML (in the layout templates) into a new div.
So, when you have this by default:
<div class="message">$[post.message]</div>
add in a new div class. We're going to call it rp_posts. Then we're going to wrap both the OPENING and CLOSING tags of the rp_posts div in an IF statement targeting the specific category ID/IDs we want to affect with the special div.
<div class="message"> {if $[category.id] == X || $[category.id] == Y} <div class="rp_posts"> {/if} $[post.message] {if $[category.id] == X || $[category.id] == Y} </div> {/if} </div> So now that you have your class rp_posts you can specifically target elements within them.
.rp_posts will be the container around the text .rp_posts img will target the image you want to put there, so adjust your CSS accordingly
you can also target any BB Code (by targeting their HTML equivalent) by preceding it with .rp_posts (eg: .rp_posts b will allow you to target bold tags just in the .rp_posts div). all CSS should work here as well, including targeting the first couple of letters in your post to make them a larger size / different font.
the problem, however, is you have your tag and your "transform" / credits class within the $[post.message] variable itself. credits is easy enough to do, by adding an additional div right after your closing .rp_posts tag, but before the closing {/if} tag, like so:
<div class="message"> {if $[category.id] == X || $[category.id] == Y} <div class="rp_posts"> {/if} $[post.message] {if $[category.id] == X || $[category.id] == Y} </div> <div class="translate"> your credits here </div> {/if} </div>
The biggest problem, though, is your tag box. I'm assuming this isn't a static element (ie, "open" will be replaced with someone's @ tag if they're tagged, or plaintext with their name). Unfortunately, while I can suggest a way to style this using layout templates, the only possible way to include a tag (which you'd want at the moment of post creation) is via plugin.
I don't know how to write this plugin myself since it would need to insert itself into the post editor, but if you add in an additional div at the beginning of this code block (like we did with the tag box), and put the plugin variable into this, it would work.
So in other words, something like this:
<div class="message"> {if $[category.id] == X || $[category.id] == Y} <div class="tag"> </div> <div class="rp_posts"> {/if} $[post.message] {if $[category.id] == X || $[category.id] == Y} </div> <div class="translate"> your credits here </div> {/if} </div>
And then ask for a plugin that does the following: 1. Inserts a textfield into the posting form 2. The field would be placed within the $[post.message] content 3. The plugin then targets the .tag div to insert the content of the textfield.
Does this make sense? Let me know if I need to clarify anything!
|
|
inherit
151650
0
Jul 29, 2018 18:13:48 GMT -8
• Ambrose •
1,077
February 2010
shoggard3
|
Post by • Ambrose • on Jul 1, 2019 7:24:11 GMT -8
Alright, thanks! I will start working with all that on my test forum so I don't mess up the official one. ^^
In the meantime, I will provide the code in an announcement so they can use it until I get it all set. I will definitely come back if there are any issues!
Edit // Regarding the plug-in, I assume there isn't one yet? I will go ask for it if there isn't!
|
|
Kami
Forum Cat
Posts: 40,037
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,037
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Jul 1, 2019 7:50:12 GMT -8
Correct, you'll have to request this plugin. It should be relatively simple so hopefully it will be filled quickly (:
|
|