inherit
239943
0
Apr 20, 2019 2:21:07 GMT -8
jrj84105
136
December 2016
jrj84105
|
Post by jrj84105 on Jan 28, 2017 14:42:27 GMT -8
How would one add the name of the board into the Title Bar (I think that's where "Create Thread" is located, left aligned). It would be nice to have the board name right aligned in the same Title Bar.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jan 28, 2017 18:56:23 GMT -8
jrj84105, Try this in your Global Header ( Admin > Structure > Headers & Footers > Global Headers & Footers > Global Header): <script> $(document).ready(function() { if (pb.data('route').name == "new_thread") { $('.title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>'); } }); </script>
If you want it on the Create Thread page as well as the full Reply page (by clicking Reply in a thread), use this instead: <script> $(document).ready(function() { if (pb.data('route').name == "new_thread" || pb.data('route').name == "new_post") { $('.title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>'); } }); </script>
If you want to get a bit fancier, and have it tell you that the name is the board you're in, you could alter this line: $('.title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>');
to something like this: $('.title-bar').append('<span><h2>: You are posting in the ' + pb.data('page').board.name + ' board.</h2></span>');
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Jan 28, 2017 20:51:30 GMT -8
This is a great idea Lynx, only how do I stop it going in to the title area of the two sidebars I have on my forum.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jan 28, 2017 21:19:49 GMT -8
Nscalerr, Try changing this line: $('.title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>');
to this: $('.container.new-area > .title-bar').append('<span><h2> - ' + pb.data('page').board.name + '</h2></span>');
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Jan 28, 2017 21:23:07 GMT -8
Thanks Lynx all working.
|
|
inherit
239943
0
Apr 20, 2019 2:21:07 GMT -8
jrj84105
136
December 2016
jrj84105
|
Post by jrj84105 on Jan 29, 2017 5:25:15 GMT -8
Thanks so much. This is really a great feature for me. I put links to Create Threads in each of my boards into my sidebar so people could create threads directly from the active threads and homepage views. Fat-fingering was causing a lot of miscategorized threads. This is a perfect fix. I really appreciate it.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jan 29, 2017 11:56:02 GMT -8
Thanks so much. This is really a great feature for me. I put links to Create Threads in each of my boards into my sidebar so people could create threads directly from the active threads and homepage views. Fat-fingering was causing a lot of miscategorized threads. This is a perfect fix. I really appreciate it. Glad it works for you!
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jan 30, 2017 22:29:41 GMT -8
For those who may prefer this in plugin format, I've done so (and even added a text color option). You can find my support thread here. If the plugin is not available in the library, you can find it on my GitHub page (link is in my signature).
|
|