Тёмный
No video :(

Squarespace accordion with images 

UI corner with J
Подписаться 3,6 тыс.
Просмотров 8 тыс.
50% 1

Squarespace accordion is pretty simple for the time being, the only 2 things it's supporting are text and links. How about images? In this video I will show you a workaround in 3 steps with javascript to make your accordion image-friendly!
Blog article:
www.ui-workarounds.com/how-to...
(on the bottom of the article you have the javascript code)
If the blog is temporarily down please use the github page:
github.com/jozsefkerekesve/ui...
P.S. How many times did I just say "Image"...well, maybe too many times !
Intro [0:00]
Step 1 - adding a bolded text [1:03]
Step 2 - adding a link on the bolded text [1:54]
Step 3 - writing the javascript code [ 4:02]

Опубликовано:

 

6 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 69   
@thedesignorder
@thedesignorder 11 месяцев назад
Thanks so much for this tute! Very helpful and worked perfectly.
@alexalbery3517
@alexalbery3517 4 месяца назад
Amazing! Thank you so much for sharing - it works perfectly!
@john.mashar
@john.mashar Год назад
Thank you so much for this! It helped me a lot :)
@uicornerwithJ
@uicornerwithJ Год назад
I will be posting after Christmas a video about tables, lists, videos in accordion. If you're interested , visit my channel in a few days. Thank you !
@loss224
@loss224 5 месяцев назад
YOU ARE THE MAN!!! THANK YOU SO MUCH
@co3319
@co3319 Год назад
So helpful. Thank you!
@uicornerwithJ
@uicornerwithJ Год назад
Thank you :)
@kbob582
@kbob582 Год назад
Absolutely ace, cheers man
@uicornerwithJ
@uicornerwithJ Год назад
Cheers ! Glad you liked it. Stay tuned because I will post soon another video about accordion with images/videos/lists/titles and tables.
@esm1jes
@esm1jes Год назад
Hi...just wanted to say thanks....your explanation and step by step instructions along with the (and especially) the code insert were fantastic. Worked first time. Now I just have to find a way to resize the image to fit my format
@uicornerwithJ
@uicornerwithJ Год назад
Thank you. just try using the following rule, just change the max-width value: .accordion-item__description img { max-width: 80% !important; }
@joyphantipasangchuj6490
@joyphantipasangchuj6490 9 месяцев назад
@@uicornerwithJ This is my first attemp playing with customised code. Can you clarify which line should this rule be added, please? Many thanks!
@uicornerwithJ
@uicornerwithJ 9 месяцев назад
@@joyphantipasangchuj6490 so in the Custom CSS Panel in top-left you can add CSS code: .accordion-item__description img { max-width: 80% !important; } This code affects the images inside an accordion item's description
@joyphantipasangchuj6490
@joyphantipasangchuj6490 9 месяцев назад
@@uicornerwithJ THANK YOU! Really appreciate YOU! I frequently build program page for my events and now I know a slick way to do it.
@GaryReinsch
@GaryReinsch 6 месяцев назад
This is a very helpful and well done tutorial. Thanks! I think that I'm going to try to add a thumbnail image to the contracted accordion block (with preview text), too. The idea: Create a "cleaner" version of a "show more/less" link. Essentially, have a thumbnail preview that switches to a larger alternate image when the item is expanded, then returns when it contracts. Have you attempted this by chance?
@nolanpudjanegara5836
@nolanpudjanegara5836 7 месяцев назад
Hi, thank you so much! I found a minor problem though, when hitting back on Google Chrome to the page with the accordion images, it would show up as links and not images, do you have a solution for this?
@mrkotyk9543
@mrkotyk9543 11 дней назад
It works a treat, but other links within the accordion have been broken and replaced with a small generic graphic - like a graphic when a url doesnt exist. Any ideas -thanks :) the links that are becoming broken are in bold
@lilyconnors439
@lilyconnors439 Год назад
Thank you so much! This was very helpful. I am wondering if there is a way to have text aligned to the right side of the image, rather than below? Thank you :)
@uicornerwithJ
@uicornerwithJ Год назад
Hi. Well you could add the text before the image and add to the text's p tag this CSS rule : float: right
@AndrewPardue
@AndrewPardue Год назад
This is so useful! Thank you. Is there an easy way to resize the photos/reduce size? It seems that if the photos are too large they bleed off the page. I'd like for them to fit exactly within the bounds of the dropdown box.
@uicornerwithJ
@uicornerwithJ Год назад
Thank you also for your comment. Yes, to have resized images just add this css code in the Custom CSS panel : .accordion-item__description img { max-width: 100%; } Also if you are interested there is a new article about accordion videos, images, lists, titles and tables on my blog: www.ui-workarounds.com/boosting-your-squarespace-accordion-with-videos-images-tables-lists-and-titles/
@AndrewPardue
@AndrewPardue Год назад
@@uicornerwithJ That worked like a charm! Amazing. Thank you so much.
@AndrewPardue
@AndrewPardue Год назад
@@uicornerwithJ thank you!! sorry to bother you again. But do you know that if you have two accordions you can set the images for one a different percentage than the other?
@uicornerwithJ
@uicornerwithJ Год назад
@@AndrewPardue Then you need to add the block id before the .accordion-item class for each accordion. For example : #block-yui_3_17_2_1_1639862049786_4061 .accordion-item_description img { max-width: 100% } #block-yui_2_1_10_3_2453145549786_4061 .accordion-item_description img { max-width: 50%; } You just have to find out the block id for each. It's easy to find out with the chrome extension called Squarespace ID finder.
@timharvey3582
@timharvey3582 Год назад
This is awesome! How do I make the images scale to the width of the screen? I tried the CSS with max-width: 100%; but it is setting the width of the image to about 1/4 screen width.
@uicornerwithJ
@uicornerwithJ Год назад
Could you provide me the url of the website for me to take a look at this problem? My email is jkvideos81@gmail.com. Just blindly I would say, try max-width: 100vw instead of max-width: 100%
@uicornerwithJ
@uicornerwithJ Год назад
If you meant to scale up the image not down then width: 100% is the solution.
@PenceFamilyGaming
@PenceFamilyGaming Год назад
Anyway to add embed RU-vid videos in the accordion?
@uicornerwithJ
@uicornerwithJ Год назад
Yes, but for that you need to use my other solution/script. This is the video where I explain it: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-bzbzHiH0djM.html
@nicolashulgich5281
@nicolashulgich5281 9 месяцев назад
Hi mate, thanks for sharing for the step by step instructions. But unfortunately it didn't work in my accordion. You've mention something about Java script. I'm just wondering if the issue I can't see the image is because of this. I can only see the word in bold which has a link that when I hit it it brings the image (as a link) but not part of the accordion section
@uicornerwithJ
@uicornerwithJ 9 месяцев назад
Hi. Yes so the javascript part is crucial to be included in the Injections menu item from top-left, the script can be fetched from my github account, mentioned in the description of this video.
@mikischiefelbein9834
@mikischiefelbein9834 4 месяца назад
Ok 1 more question! Is it possible to link these images to an exterior URL? Or add a button underneath?
@uicornerwithJ
@uicornerwithJ 4 месяца назад
I made a new script for that: gist.github.com/jozsefkerekesdev/8b9f7bd8fd3745cb13cd5de5484b0656 All you need to do is add the text imagelink and add a link on this text and it should be before your "link that will become an image", like this : imagelink HereGoesYourLInkThatBecomesAnImage So the imagelink text will have a link on it to your exterior URL and that link will be wrapped eventually around your image by the help of this script that I just wrote.
@HaXb0xdesigns
@HaXb0xdesigns 7 месяцев назад
Hey, great tutorial, very helpful! Do you know if it's possible to arrange the images horizontally instead of vertically? I'm trying to have 4-5 images displayed on the same row next to each other and not have a separate row for each. Thank you!
@uicornerwithJ
@uicornerwithJ 7 месяцев назад
Hey. that should work just by adding the links in the editor in the same line. Squarespace does it that way by default.
@HaXb0xdesigns
@HaXb0xdesigns 7 месяцев назад
@@uicornerwithJ Thanks for the reply! I already added them like that in the same line. Is it possible that they show on separate rows due to their dimensions?
@uicornerwithJ
@uicornerwithJ 7 месяцев назад
@@HaXb0xdesigns Yes, that could be one reason.
@user-yf6hp3cy8h
@user-yf6hp3cy8h 7 месяцев назад
Him that is great and thank you so much for your help with this - my only issue is that the mobile view doesn't work, as the image is huge, what can I do?
@uicornerwithJ
@uicornerwithJ 7 месяцев назад
Hi, this is a common problem, you can retake the script from the github link in the video description, I added a maximum width of 100% to the images.
@user-yf6hp3cy8h
@user-yf6hp3cy8h 7 месяцев назад
Thank you so much@@uicornerwithJ - all working great now. Thank you
@ontrendcreativestudio
@ontrendcreativestudio Год назад
I am adding the code to the CSS panel to resize the images but in mobile view they still bleed off of the page! Any thoughts?
@uicornerwithJ
@uicornerwithJ Год назад
I would use something like this, to make sure it won't extend over the screen. .accordion-item__description img { max-width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; margin-left: 0 !important; } This css code has to be in the custom CSS box. Used in other place like code injection or page specific style section, then you need to use the style tag around this CSS code ...
@christin-markop7189
@christin-markop7189 Год назад
Thank you for this tutorial! I followed it, but it's not working for me. I use SQSP 7.1 and also checked the accordion-selector name. I can't find any differences or mistakes in my code. Is there something I might be missing?
@uicornerwithJ
@uicornerwithJ Год назад
I am not sure how your implementation looks like but I can give a few pointers : 1. First add the bold on the text after that the link with an image url (the bold is very important) 2. You should add the script in the injection menu on top, but if you add it only on that page where you have the accordion than please add at the beginning of the script this tag and on the end of the script this tag 3. Scripts don't work with personal account(only higher - business) 4. You won't see the image in preview mode, only after you saved the modifications
@christin-markop7189
@christin-markop7189 Год назад
​@@uicornerwithJ Thank you for the ideas. I checked them all, but unfortunately it's still not working for me. I even copy-pasted the code from your website, to make sure I didn't mistake somewhere in there. But no. I'll go on without this nice addition. Thanks for your answer tho!
@uicornerwithJ
@uicornerwithJ Год назад
​@@christin-markop7189 It's hard to know what the problem is without seeing it. I have this solution added to 1 of my client's website. She is using Squarespace 7.1 business plan and the images show up.
@mikischiefelbein9834
@mikischiefelbein9834 4 месяца назад
Hi there! I'm getting a "syntax error" for the first line of code. Sorry I'm a novice, any insight into how to correct this error? Thank you!
@mikischiefelbein9834
@mikischiefelbein9834 4 месяца назад
GOT IT! Thank you!
@Jakeb2392
@Jakeb2392 Год назад
lets say i wanted to add a soundcloud embeded player in these accordians can i do that?
@uicornerwithJ
@uicornerwithJ 11 месяцев назад
No, not yet
@aleksandarjeremicmulero1453
@aleksandarjeremicmulero1453 9 месяцев назад
Hey… thank you so much. It works but how can I change the size of the image. I think my image is to large and it doesn’t change it automatically. May you can help. I don’t have any css skills 🙄
@alejandrojeremicmulero1991
@alejandrojeremicmulero1991 9 месяцев назад
I figured out, that it works on normal pages, but not on product pages. Do you have an idea ? Thx a lot :-)
@uicornerwithJ
@uicornerwithJ 9 месяцев назад
@@alejandrojeremicmulero1991 I changed the script, to make it easier for you, just take the new code: github.com/jozsefkerekesdev/ui-corner-with-J/edit/main/accordion-with-images.js Also there are newer versions for this code, that work better and support also videos: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-JHsP_iG1Kic.html Also I want to let you know that there will be soon a version where you will just click on an icon and select an image and you will have also settings to make image side-by-side or set the image size etc. Stay tuned.
@LMH2502
@LMH2502 Год назад
Hi , Thanks for the great tutorial. The link for javascript has broken. Can you help share again? Thanks!!!!
@uicornerwithJ
@uicornerwithJ Год назад
I will update my video description with this link: github.com/jozsefkerekesve/ui-corner-with-J/blob/main/accordion-with-images.js
@uicornerwithJ
@uicornerwithJ Год назад
Dreamhost hosting service where I have my website has issues and it is down since Sunday. As for backup I will keep the codes also on Github.
@mblm5532
@mblm5532 Год назад
Is it possible to do this with .pdf instead of image?
@uicornerwithJ
@uicornerwithJ Год назад
No, but I will implement this verry soon
@JasonAlder
@JasonAlder 6 месяцев назад
Thanks! I'm trying to use this as a dropdown link menu. Is there a way to also turn the images into links?
@uicornerwithJ
@uicornerwithJ 3 месяца назад
Yes just take this code and before your image add a link that has the text "imagelink" -- gist.github.com/jozsefkerekesdev/8b9f7bd8fd3745cb13cd5de5484b0656
@JasonAlder
@JasonAlder 3 месяца назад
@@uicornerwithJ great thanks, I’ll try that!
@JasonAlder
@JasonAlder 3 месяца назад
@@uicornerwithJ Hi, just working on this now and want to make sure I understand the syntax. So in the Accordian description box, before the text I make Bold that will turn into the image, I should write imagelink and make it a link for where I want the image to link to? Is that right?
@uicornerwithJ
@uicornerwithJ 3 месяца назад
@@JasonAlder yes, so for example you want your image to link to foreveryoung.com so you write imagelink myimage or whatever so the first link's href value will transpose to the second links href value and you will have an image with a link going to foreveryoung website. (I mean you create the link with the editor)
@JasonAlder
@JasonAlder 3 месяца назад
@@uicornerwithJ ok yes, that’s what I have done… I wrote the text imagelink in the Accordian description box, made it a link to where I want it to go, then wrote the text for my image and linked it to the image. But what I end up with is the text imagelink as a link. Can I email you?
@kellycruz145
@kellycruz145 19 дней назад
how about image with a link?
@kayleyedwards7738
@kayleyedwards7738 11 месяцев назад
Hi - thank you for sharing this. I've used the following code but it breaks links to pdfs in other accordions throughout the site. Any idea what would need to be changed in the code to prevent this? Thank you document.querySelectorAll('.accordion-item__description').forEach((item) => { [...item.querySelectorAll('a')].forEach((link) => { if(link.querySelector('strong')) { const imgSrc = link.href; const img = document.createElement('img'); img.src = imgSrc; img.alt = link.querySelector('strong').innerText; link.replaceWith(img); } }) }); Then added the following code to resize the image #block-d4190c7c4996f151b8c6 .accordion-item__description img { max-width: 100%; }
@uicornerwithJ
@uicornerwithJ 11 месяцев назад
Could you provide me with a link to your website? The links are turned into images only if the link has a strong tag inside of it. Otherwise it shouldn't affect the pdf links.
Далее
Tabbed Sections in Squarespace 7.1
6:57
Просмотров 17 тыс.
Пиратские котики
00:50
Просмотров 144 тыс.
Squarespace 7.1 NEW FEATURE: Pinning Blocks
9:08
Просмотров 4 тыс.