Nikitaly Posted June 19, 2023 Posted June 19, 2023 Hi, Can anyone help? I'm trying to add a code block (containing custom social icons) at the top of the page to match the other pages on the website. Not sure where to start. site: https://walrus-springtail-ljhd.squarespace.com/workshop-events?p pw: 1mageproblem thanks
creedon Posted June 19, 2023 Posted June 19, 2023 Do you want the social icons at the top of each event detail page? Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nikitaly Posted June 28, 2023 Author Posted June 28, 2023 Hi Creedon, Thanks for replying. No. We'd like the social icons on jut the main store page.
creedon Posted June 28, 2023 Posted June 28, 2023 I'm confused. Is this for an event page or a store page? You've mentioned both. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nikitaly Posted July 4, 2023 Author Posted July 4, 2023 Apologies. We'd like it on both in fact. thanks for replying.
creedon Posted July 4, 2023 Posted July 4, 2023 (edited) The general technique that can be used is to add a code block to the footer of your site with the custom code you've used. Hide that with CSS. Now with JavaScript you can move that block wherever you want. I'd put the JavaScript in the page header code injection for those pages. For the two pages you mention you could move the element after the page title element ( .page-title ). If you put the code block in the footer and hide it with CSS we may be able to come up with some code to move it into place. Edited July 5, 2023 by creedon Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nikitaly Posted July 5, 2023 Author Posted July 5, 2023 Thanks Creedon, I've almost got it but the social icons are spread across the whole width of the page instead of in a block on the right (as on other pages). Code used: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function() { $('#social-hide').insertBefore('.page-title'); }); </script> code block: <div id="social-hide" style="text-align:right !important" > <ul class="social-icons"> <li><a href="https://www.pinterest.co.uk/rebelrebele8/" class="social-icon"><img class="social-icon" src="https://static1.squarespace.com/static/5a045bf8a9db09cbf239e375/t/5a69ff9724a6944f0dc5815b/1516896151713/ICON_Pinterest+blue.png"></a></li> <li><a href="https://www.instagram.com/rebelrebele8" class="social-icon"><img class="social-icon" src="https://static1.squarespace.com/static/5a045bf8a9db09cbf239e375/t/5a69ff9324a6944f0dc57fc2/1516896148015/ICON_instagram+blue.png"></a></li> <li><a href="https://en-gb.facebook.com/RebelRebelE8" class="social-icon"><img class="social-icon" src="https://static1.squarespace.com/static/5a045bf8a9db09cbf239e375/t/5a69ff90e2c483be24a907ee/1516896144241/ICON_Facebook+blue.png"></a></li> <li><a href="https://twitter.com/RebelRebelE8" class="social-icon"><img class="social-icon" src="https://static1.squarespace.com/static/5a045bf8a9db09cbf239e375/t/5a69ff9971c10b67cf864516/1516896153314/ICON_Twitter+blue.png"></a></li> </ul> </div> https://pelican-plantain-cha4.squarespace.com/order-online?p pw: 2022! Your help is much appreciated. Thanks.
Solution creedon Posted July 5, 2023 Solution Posted July 5, 2023 12 hours ago, Nikitaly said: I've almost got it but the social icons are spread across the whole width of the page instead of in a block on the right (as on other pages). There are multiple ways you could go about it. Here is one. .page-text-wrapper { display : flex; flex-direction : column; } #social-hide { align-self : end; width : 50%; } Let us know how it goes. Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nikitaly Posted July 6, 2023 Author Posted July 6, 2023 Thank you so much! Final css: .page-text-wrapper { display : flex; flex-direction : column; } @media screen and (min-width: 641px) { #social-hide { align-self : end; width : 25%; } } @media screen and (max-width: 640px) { #social-hide { align-self : end; width : 50%; } } creedon 1
Nikitaly Posted July 7, 2023 Author Posted July 7, 2023 Hi again, I know I said I'd got it BUT I hadn't realised that the 'social-hide' div is also showing in the footer (just it happens to be almost the same colour as the background. How do I hide it and then unhide it just for the store and event pages? Any help would be much appreciated. I really know no javascript! thanks
creedon Posted July 7, 2023 Posted July 7, 2023 Quote I really know no javascript! The hiding of the social block in the footer is purely a CSS issue. #footer #block-yui_3_17_2_1_1673944491125_5415 { display : none; } Let us know how it goes. Nikitaly 1 Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.
Nikitaly Posted July 8, 2023 Author Posted July 8, 2023 Hi, Sorry. Brain fog. Hid footer div as follows: #footer.site-footer #social-hide { display: none; } All fine now. Thanks creedon 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment