The trick is that when you click the logo, you’re taken to the site home rather than the category. This is (mostly) solved by the following:
<script type="text/javascript">
$(document).ready(function() {
$(".title #site-text-logo").click(function(event){
// don't navigate to base url
event.preventDefault();
// get category active from div id
div = $("body[class*='category-']")[0];
// extract slug from class that startswith category-
var classes = $(div).attr('class');
var slug = classes.match(/category\-.+/g)[0].replace("category-","").split(" ")[0];
// set the href to be the slug url
document.location = "/c/" + slug + "/";
})
});
</script>
If you click on the logo on either a category or topic page, you go to the category page. Hooray!
BUT if you click in the tiny space between the logo and the bottom of that header, you go to the home page rather than the category page. It’s pretty much impossible to distinguish when you’ll get which action. When you mouse over the URL at the bottom of Chrome has the site home page rather than the category URL regardless of where you’re going to go.
(I used Custom Header Links to add a link to the home page. I don’t believe that it has anything to do with the above behavior.)
And I can’t share the site because the per-unit categories are visible only to group members.
You rock. I totally appreciate it. Get me to solve a duplicate key in postgres, sure, but the only the simplest CSS makes sense and I only barely even understand the syntax of javascript.
Maybe I should just do something like that instead? Though I’m not sure how to know which categories want their home page remapped. Maybe a site setting with an array of category IDs? I think I can google my way through getting the current category and seeing if that ID is in an array in a site setting.
EDIT: Hmm, but I can’t tell how in a <script type="text/javascript"> to tell what the category of the current . . . page? . . . is to selectively change the setDefaultHomepage.
Does that seem easier?
But back to the original solution
I think that sounds right to me, but that doesn’t mean much.
I think it’s that somehow the<h1> does the Right Thing, but that the <a> is going to the site home?
I’m just a caveman. I don’t quite know what that means. There’s some stuff that seems a lot like that in the javascript already. Would I make a whole-nuther one of those $(document).ready(function() { things? or add just another $(".title #site-text-logo").click(function(event){ in there somehow?
The thing I tried didn’t seem to do anything different.
I sort of understood this one better and did this:
/* keep tiny bit near logo from linking to home page */
.title a {pointer-events: none;}
This one changed something! And I see that it worked because now none of the logo will do anything.