Lynnster Posted August 6 Share Posted August 6 My client wants his portfolio to have hover titles which show the client on one line and the director on a second line. I've customized the text size and figured out how to make it look the way he wants in css. He has multiple portfolio categories (commercial, work, shorts) and I know they are all linked but I thought using the page or section ID to add the directors individually for each page would work. Unfortunately, it hasn't and the same directors end up being repeated on all the portfolio pages (which is incorrect). How can I make this work? Here is the current code I've got in there for Commercial (but it's showing the directors for Automotive): .portfolio-title:after{ white-space:pre; content:"\A Second Line"; text-transform:uppercase; font-size: 1.5rem } #collection-669afebe90bae63ebf312da9 { .target-here { .grid-item:nth-of-type(1) .portfolio-title:after{ white-space:pre; content:"\A JOANN LEMOINE" } .grid-item:nth-of-type(2) .portfolio-title:after{ white-space:pre; content:"\A Dave Laden" } etc. etc. for each director... Can this be done? Hellllp! Link to comment
Lesum Posted August 6 Share Posted August 6 @Lynnster I'm not exactly sure what you're trying to achieve here. Can you share your site URL for context, assuming you've already added the custom code you mentioned in your post? If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee? Link to comment
Lynnster Posted August 6 Author Share Posted August 6 (edited) @Lesum I included the site url when I created this. I didn't realize it wouldn't include it. Here it is. Maybe I didn't explain it right...? Each portfolio has different categories of video work, and thumbnails are featured in the Grid Overlay Portfolio. I added a dark hover and the titles of the videos appear in white. He wanted the director of the piece to be on a second line in smaller text. I accomplished this by putting each director's name in css (see code above). I tested it on the "Commercial" category. It looked perfect! The problem happened when I went to the second category ("Automotive") and put css in, because the directors then appeared the same for the videos on Commercial and Automotive. So I tried to call out each specific page to say "These directors only appear on this page" basically. I thought it would work and it did not. I need the directors to be correct for each video. ALSO... I now realize the css does not work on the mobile view and the directors aren't showing up at all. Does that make more sense??? Edited August 6 by Lynnster Forgot to reply to a specific person. Link to comment
Lynnster Posted August 6 Author Share Posted August 6 Nevermind on the mobile comment. I fixed that! Now I just need to get the right directors credited for their videos! 🙂 Link to comment
Solution Lesum Posted August 6 Solution Share Posted August 6 Instead of using an nth-of-type selector that targets all portfolio items, you need to target each portfolio item based on its URL. First, add your Director name in the content: "Director name" section of the code. Next, go to your portfolio folder in the Squarespace editor. For the individual project where you want to add the director name, navigate to Settings > URL Slug and copy the entire text under URL Slug. For the first project in the second category ("Automotive"), it might look like this: /auto/lincoln-uncharted-waters Replace href="/category-name/project-name" in the code with the copied URL slug from step 2. Refer to the screenshots: Here's the code you need to add under Website > Pages > Website Tools > Custom CSS. This will display a director name for the specified project on your site. .portfolio-title:after { display: block; } a.grid-item[href="/category-name/project-name"] .portfolio-title:after { content: "Director name"; } For the first project in the second category ('Automotive'), the code should look like the following. This block of code needs to be added for each project, changing the URL and directory name text in the content: section accordingly. a.grid-item[href="/auto/lincoln-uncharted-waters"] .portfolio-title:after { content: "Director name"; } If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. Sam Web Developer & Digital Designer ☕ Did you find my contribution helpful? Buy me a coffee? Link to comment
Lynnster Posted August 6 Author Share Posted August 6 That worked! Thank you!!! I'm glad there was a way the director and title could be linked better, I was worried about things getting mixed up if the order had to change. Lesum 1 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