omeka-s
omeka-s copied to clipboard
Simplify site title/logo handling
Existing helpers that simplify title handling for pages don't really work well for the logo.
So, we do have a helper that simplifies this somewhat already that's not really in use in the themes: the themeSettingAsset
helper, together with pre-existing thumbnail
, which would at least mean that themes would not have to manually write out the img tag as they do now.
The theory behind this issue was more about the "page title" helper: which takes in a title and automatically adds it to the HTML title element while also printing it out: way back before we had logos we used this to do the h1s... since these are also links though... it just wouldn't work here.
We could certainly make a helper that encapsulates all this "print the logo or the title" logic... though then it starts to look like we should not have logo be a theme setting and rather a site setting, which has its own consequences. We could also make a helper that works like "print out an asset from theme settings if one is set, using this given text as the alt, and if there is no asset then just print the text" (so basically just a generalized version of the logic used to print the title)... but I'm not sure if we'd really use that pattern elsewhere.
@kimisgold can weigh in here as this is really a theme question... it may be sufficient to just say we don't really need additional helpers here
I think keeping the logo a theme setting makes sense: a project could have logo versions that make more sense for the associated theme, like a white and transparent logo could work better in one context while full color better in another.
so basically just a generalized version of the logic used to print the title
I like this solution. All the themes already include a logo setting, and the main use case I see for not including one is if you are making a project-specific theme that does not need a logo image. I'm not sure how many pattern usages we feel we need to justify this helper, but I can see the home link pattern being used both in headers and footers; a helper to keep that markup consistent could be useful.