I'm looking to do a simple customization of the document view template based on the space that the document is in. Being a FTL newb, I'm looking for advice!
We now have two "themes". Our global theme, and what I'll call our "Special space!" theme. Every document that is in one of the Special Spaces needs to have a mildly different look to it, including a small image near the top.
I've already branded the special spaces so that when you go to those spaces, you see the custom theme with the Special Space logo on it.. but if you go to a document inside the special space, you have no indication that this document is (or is not) in a special space.
What'd like to do is add some logic in the template that adds a little Image at the top (a sort of Stamp of Approval-type image) on any document that's in one of the Special Spaces.
What I'd REALLY like is the following (in pseudo-code) in the document-view template:
if (spaceThatContainsThisDoc.theme IS "Special Space Theme") {
<img style="float over to the right nicely" src="sealofapproval.png">
}
I guess an acceptable approach (but definitely not the Right way) would be:
if (spaceThatContainsThisDoc IS ("SpecialSpace1" OR "SpecialSpace2" OR "SpecialestSpace" OR etc) {
<img style="float over to the right" src="sealofapproval.png">
}
Advice and criticism is appreciated.
(note: i'm using clearspace 2.0.8)
It's unfortunate that nobody replied to your post. I don't know if you still need this information, but I've done similar adjustments with Clearspace Community 2.5. I just upgraded a site Clearspace 2.0.x to 2.5. There are definitely a lot of differences in the themes between 2.0.x and 2.5.
I'll post what I know for anyone about CS 2.5.x for anyone who may have the same question.
In CS Community, you have three variables to check, depending on where you are in the community/sub-community tree.
${community.name}
${container.name}
${container.parentCommunity.name}
Here's an example...
<#assign commName = community.name?html?to_lower /> <#assign containName = conatiner.name?html?to_lower /> <#assign parentName = container.parentCommunity.name?html?to_lower /> <#if (commName?? && commName == "special space") || (commName?? && containerName == "special space") || (parentName?? && parentName == "special space"))> <#assign specialSpace = true /> <#else> <#assign specialSpace = false /> </#if> |
Then you can check for that variable throughout your theme.
Thanks, Brian. That looks to be exactly what I was looking for. Conveniently, we've just (finally) started upgrading to 2.5. I put off solving the problem due to this pending update, and now you've saved me a lot of research time. I'll reply with any more details if I run into anything as I'm implementing.