Design + Coding > Sidebar Selective Display -- how to control pages not listed for 'show' or 'dont show'???

OK, so I am using Selective Display for the sidebar content to have certain sections of navigation show in specific sections of the website. However, since the 'show on' option does not include the links in the section I need to show (weird), I have to use the other option of 'do not show on' and select all the pages I dont want the sidebar section to show up on.

This results in a number of problems that have been mentioned before in this forum, mainly that it is very cumbersome for a site that has a lot of content, and requires much more work than necessary every time a new page is added, but also results in this major problem:

pages that are in some respects auto-generated and are not listed in the 'do not show' list, and also do not have a unique page id to target specifically, end up with all the sidebar sections piled up on the page (ie: like this page) -- How do I fix this? either to only display the section/s I want to show up on these pages, or to at the very least set the page to full width with no sidebars. There are lots of these pages that I'm trying to track down, so far here is my list:

-- some login pages that are auto-generated (Guest Login)
-- account validation / login page when a new account is created (Guest Login)
-- Recover Password
-- Update Account Password
-- Password Updated
-- some search pages, etc
-- i'm sure there are more

I have been able to control some of the pages but not all of them. I have also tried jQuery with no luck so far. My jQuery attempt:

<script src="/storage/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript">

if(document.title == Squarespace.Constants.WEBSITE_TITLE + " - Recover Password"){
$(#sidebar1Wrapper).css("display","none !important");
$(#content).css("width","630px !important");
};

</script>


Please help! I run into this problem on most sites I build on Squarespace, but it is very important to get this resolved ASAP for this particular project. Any help is appreciated!! I submitted a support ticket as well since I view it is a sort of internal glitch (unless there is a work-around I'm unaware of!), but I thought I would also throw it out into the forum in my desperation!!

Thanks! Dana Asper / VUELA

09.11.2009 | Registered CommenterVUELA

Dana,

If you do enough digging here, you will eventually find the workaround to "Bonnie's Pet Peeve" described in several posts. Perhaps the most succinct is this post by Bonnie herself.

Using this method lets you use the "show when page is active" option, and avoid all the complications associated with the inverse "show when page is not active" method -- which everyone agrees is not a viable alternative, for all the reasons you have described.

--Chris

09.12.2009 | Registered CommenterChris Loosley

Thanks chris! I think I remember readingpart of that thread before and I posted a response there as well. I def consider this amajor bug with the system and have yet to see a solution that would work and keep the site editable by the client. I'm extremely frstrated right now and hoping that with some more work I can get a jquery solution worked out -- at least temporarily before SQ realizes they really need to fix this ASAP. I would hate to have to rebuild the several large projects I'm working on now on a different platform right when they are almost completed. eew. Makes me a little nauseous.

09.12.2009 | Registered CommenterVUELA

Dana,

I don't really have a good suggestion about what to do in this situation. But I do see that your jQuery statements need quotes around the selectors. Try this:

$("#sidebar1Wrapper").css("display","none !important");
$("#content").css("width","630px !important");

Having said that, if I were trying to apply a common style to a collection of otherwise dissimilar pages, and I could not recognize those pages by looking for a "modulePagennnnnnn" id in their body tag in the normal way, here's what I would do. I would use jQuery to inspect the pages for some other unique distinguishing features, which could be specific to each type of page I wanted to target, and whenever such a feature was detected I would add my own unique class to the #canvasWrapper div (or to the html body tag, if necessary). Then I would use custom CSS styles to control the appearance of those pages, in the standard way.

Write a follow-up post if you think this approach would work for your case, and need more help implementing it.
--Chris

09.12.2009 | Registered CommenterChris Loosley

Of coarse I'm missing quotes! Thanks for that, I need to play with it some more. I haven't been able to find a common denominator in the pages I need to modify. I'd be curious if you have an idea for that - could be the solution we're looking for!

09.12.2009 | Registered CommenterVUELA

Added in my missing quotes and tried every tweak i could think of with no luck so far. maybe instead of targeting document.title (document.title == Squarespace.Constants.WEBSITE_TITLE + " - Recover Password"), I should target the content of the .document-title class? i will probably try that next.

09.12.2009 | Unregistered CommenterVUELA

Ok, so as long as I can target the text used in the page's .document-title class (or maybe there is something better to target?), then I can assign a class to the page and then style in the css:

$(function(){
$('#content .document-title:contains(Recover Password)').each(function(){
$("body").addClass("miscPage");
});
});

Let's hope this works for all the pages I need to target!!
Thanks for the idea Chris!!!

09.12.2009 | Unregistered CommenterVUELA

This is what worked for me for Author Profile pages:

$(function(){
$('#content .body:contains(This is your author profile page)').each(function(){
$("body").addClass("miscPage");
});
});

09.12.2009 | Registered CommenterVUELA

Dana,

[You posted 2 more times while I was writing this, but I think it's still relevant]

My suggestion would be to forget about looking for a "common denominator". Code as many jQuery statements as you need to find all the pages, one per page type if necessary. Each one would have the form:

$(distinguishing feature).closest("div#canvasWrapper").addClass("myClass");

The jQuery selectors are more powerful than CSS selectors, you can look for specific text on a page if that's the only distinguishing feature of that page. And when you find a page that qualifies, the closest method traverses the page to find the first parent element matching its selector, and there is only one div with an id of "canvasWrapper", so no matter where you find a match on a page, the result of every statement is the same.

So pages either match your criteria and acquire the special class, or they don't. And once you have added the class "myClass" to the #canvasWrapper div, you can style that page using CSS:

#canvasWrapper.myClass .section ... etc ...

--Chris

09.12.2009 | Registered CommenterChris Loosley

This works great! Thanks Chris, you're awesome! By the time I get my current projects wrapped up I should end up (hopefully) with a nice neat set of "SQ auto pages" called out through jQuery and classed so that they can be styled and so the sidebars can be addressed. hooray!

Of coarse we still have the major issue that it's a huge pain and shouldnt need to be this way, and that using the selective display method of "do not show on these pages" is extremely cumbersome for large sites - especially for client editability ... its a bit embarassing when i have to walk them through that bit of workflow!

Thanks again Chris!

09.12.2009 | Registered CommenterVUELA

Dana,

It would be useful if you could post your jQuery code here when you get it working. That will save someone (including me :) the effort of reinventing this particular wheel.

--Chris

09.12.2009 | Registered CommenterChris Loosley

Still a work in progress to get all the misc pages - and is a bit sloppy (will update as I go along) but here is what I have so far (also includes a redirect for the 'Page Not Found' -- i like to set mine to my search page and then include some text on it for if they got there by accident):

<script src="/storage/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript">

var searchURL = "/search/";
if(document.title == Squarespace.Constants.WEBSITE_TITLE + " - Page Not Found"){
location = searchURL;
};

$(function(){
$('#content .document-title:contains(Recover Password), #content .document-title:contains(Update Account Password), #content .document-title:contains(Password updated)').each(function(){
$("body").addClass("miscPage");
});
});

$(function(){
$('#content .body:contains(This is your author profile page)').each(function(){
$("body").addClass("miscPage");
});
});

</script>

then apply the css you want to the class you added. currently mine are all set to .miscPage

09.12.2009 | Registered CommenterVUELA

Before anything, thanks to all who help in this forum.

I feel so lost, like a puppy in the middle of Socalo, Mexico. The very day of independence.

And I will not do anything to solve it. If a lost like me, come to my website and I do show any section in my sidebar, is uncomfortable but I will not do anything to fix the system.

Please listen to what Dana says and do something asap.

09.15.2009 | Registered CommenterAdrián

Hello! The good staff at Squarespace has assured me that this issue will be addressed in their next update (I have been told that is in fact a larger, more difficult issue than it seems from the outside) and that they are working diligently to fix the problem.

In the meantime, here is the only process I have found so far that works for me (and keeps the site client-editable).:

-- use the built-in selective display feature and when required use the 'do not show' option to check off all the pages you do not want the sidebar section to show on. yes, this is very cumbersome and creates a ton of work, but until the next rollout of Squarespace this is the option.

-- to solve the problem of the auto-generated / misc pages that pop up from time to time, that are not included in the selective display list, some jQuery and CSS can help out:

1. upload the jQuery file to your site storage (you can get the file at jquery.com)
2. add the following code to your Website Mangement > Website Settings > Code Injection:
(the following code redirects the 'Page Not Found' page to a new page of your choice - I used a search page, and then goes on to target other misc pages that Squarespace in a sense auto-generates and that cannot be targeted by other means. -- make sure that file paths and names in the following code match your own values)

<script src="/storage/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
<!--

//***************************************
// Redirect Page Not Found
//***************************************
var searchURL = "/search/";
if(document.title == Squarespace.Constants.WEBSITE_TITLE + " - Page Not Found"){
location = searchURL;
};

//***************************************
// Target Misc Pages
//***************************************
$(function(){
$('#content .document-title:contains(Recover Password), #content .document-title:contains(Update Account Password), #content .document-title:contains(Password updated)').each(function(){
$("body").addClass("miscPage");
});

$('#content .body:contains(This is your author profile page)').each(function(){
$("body").addClass("miscPage");
});

$('#content .document-title:contains(Change Tracker)').each(function(){
$("body").addClass("miscPage");
});

$('#content .document-title:contains(Website Login), #content .document-title:contains(Login)').each(function(){
$("body").addClass("miscPage");
});

});
-->
</script>

3. in the Style Editing Mode > Custom CSS, enter some modifications for the pages that you labeled as .miscPage in the code above:

(Here is just a sample from what I did on one project)

.miscPage #sidebar1Wrapper { display: none; }
.miscPage #sidebar2Wrapper { display: none; }
.miscPage #content { width: 865px; }

with this css, both sidebars are completely removed and the content area is the full width (change the width to what is appropriate for your own layout).

It would have been great if Squarespace had offered some sort of scripted solution for those that depserately needed a work-around, but I am confident that the next rollout of Squarespace will knock our socks off!! Until then, this is the solution I am using ... let me know if you've found a better way!!! It looks like chris' code line is a bit sleeker so maybe I will revert to that, but it is using the same idea.

09.15.2009 | Registered CommenterVUELA

I had tha same problem but This solution works. Thanks for the last resume.

04.17.2010 | Unregistered CommenterErly