BFGS Posted October 17, 2021 Share Posted October 17, 2021 Site URL: https://bassoon-aardvark-m9nc.squarespace.com/board I am using the list feature to show board member photos on a client's site. I would like a line break in the Content Title so that it is First Name <br> Last Name. This currently happens automatically for most names, but not all due to length. It is not possible to add html or returns in the Content Title field. So how might I achieve this? Website linked above. Password: pipclt Link to comment
Agha_Waqas Posted October 17, 2021 Share Posted October 17, 2021 Hi. You need to add a piece of javascript code for that. Link to comment
tuanphan Posted October 18, 2021 Share Posted October 18, 2021 14 hours ago, BFGS said: Site URL: https://bassoon-aardvark-m9nc.squarespace.com/board I am using the list feature to show board member photos on a client's site. I would like a line break in the Content Title so that it is First Name <br> Last Name. This currently happens automatically for most names, but not all due to length. It is not possible to add html or returns in the Content Title field. So how might I achieve this? Website linked above. Password: pipclt Can you add & keep <br/> for a name? We can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
BFGS Posted October 18, 2021 Author Share Posted October 18, 2021 1 hour ago, tuanphan said: Can you add & keep <br/> for a name? We can check easier Honored to receive a reply from you, @tuanphan! I'm not sure what you mean. I'm not able to add a break tag in the title of a list. Please see the image I've attached. I know I need to inject JS for this task but not exactly sure how to make it work. Link to comment
tuanphan Posted October 20, 2021 Share Posted October 20, 2021 On 10/18/2021 at 3:58 PM, BFGS said: Honored to receive a reply from you, @tuanphan! I'm not sure what you mean. I'm not able to add a break tag in the title of a list. Please see the image I've attached. I know I need to inject JS for this task but not exactly sure how to make it work. Hi, I mean add br to TITLE field. It should be: Barbara <br/> Hall When you're done, let me know. I will test some code to make Squarespace allow br tag to run. Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
BFGS Posted October 20, 2021 Author Share Posted October 20, 2021 2 hours ago, tuanphan said: Hi, I mean add br to TITLE field. It should be: Barbara <br/> Hall When you're done, let me know. I will test some code to make Squarespace allow br tag to run. Oh, I see what you mean. Okay, I have completed that. And thank you so much! Link to comment
tuanphan Posted October 22, 2021 Share Posted October 22, 2021 On 10/20/2021 at 9:58 PM, BFGS said: Oh, I see what you mean. Okay, I have completed that. And thank you so much! Add this to Last line in Code Injection > Footer <style> $(document).ready(function(){ $("h2.list-item-content__title").each(function(){ $(this).html($(this).text()); }); }); </style> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
BFGS Posted October 22, 2021 Author Share Posted October 22, 2021 6 hours ago, tuanphan said: Add this to Last line in Code Injection > Footer <style> $(document).ready(function(){ $("h2.list-item-content__title").each(function(){ $(this).html($(this).text()); }); }); </style> I've completed this but it has not done what's expected. The </br> tag still shows in the HTML. Link to comment
tuanphan Posted October 25, 2021 Share Posted October 25, 2021 On 10/22/2021 at 11:51 PM, BFGS said: I've completed this but it has not done what's expected. The </br> tag still shows in the HTML. ah, typo, script, not style, use this new code <script> $(document).ready(function(){ $("h2.list-item-content__title").each(function(){ $(this).html($(this).text()); }); }); </script> Rangifer, BFGS and calibratedconcepts 3 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
BFGS Posted October 25, 2021 Author Share Posted October 25, 2021 18 hours ago, tuanphan said: ah, typo, script, not style, use this new code <script> $(document).ready(function(){ $("h2.list-item-content__title").each(function(){ $(this).html($(this).text()); }); }); </script> I probably should've caught that myself! Thank you SO much for your time and code. It worked! Very grateful for your awesome humanity. Link to comment
MS_coder Posted May 24, 2022 Share Posted May 24, 2022 Just wanted to add to this since I was referencing the same question and couldn't get the code to work. ( It seems obvious now, but wasn't thinking at the time. ) In order for the code to work you need to load the jquery into the header code injection. So in all: Header add - <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> Footer add - <script> $(document).ready(function(){ $("h2.list-item-content__title").each(function(){ $(this).html($(this).text()); }); }); </script> Hope that helps. calibratedconcepts and Rangifer 2 Link to comment
Rangifer Posted September 5 Share Posted September 5 Hi! Thank you so much for such an easy solution! I had been struggling to figure this out. Is there a way to change the font size of the text in the second line to make it smaller? Something like they did here but with the title? Thank you very much! Link to comment
tuanphan Posted September 7 Share Posted September 7 On 9/6/2023 at 5:24 AM, Rangifer said: Hi! Thank you so much for such an easy solution! I had been struggling to figure this out. Is there a way to change the font size of the text in the second line to make it smaller? Something like they did here but with the title? Thank you very much! Can you share link to page where you use title? We can adjust code easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment