I need to change our working custom theme for Omeka S 3.x.x to make a version for Omeka S 4.x when we upgrade.
Is there a document that would tell me where directories and files from the old format need to go in the new format and anything new that I have to add for 4.x that didn’t previously exist for 3?
Our old version is based on the default theme.
1 Like
A 3.x theme will usually work fine with 4.x, if you just change the version specification in its ini file to allow usage with 4.
The big things with 4 are some new features you can choose to use in your theme, like configurable resource page blocks or page and block templates, but these features aren’t mandatory for themes to use.
Thanks for the information. I have been comparing the most recent default theme to ours and I see some different files, probably from modules that we installed.
Just to be clear, I don’t need to change the block-layout directory to block-template, or add the page-template directory?
And I don’t need to move the .scss files up a level from the _blocks directory into the asset/sass/ directory?
I am starting to realize that I may have misunderstood how themes work. I am trying to match our custom format to the files in the most recent Default theme, because that was what ours was originally based on. However, the person who customized ours may have gone in a different direction especially with the Sass files.
I think it also depends on how much you customised, and how much you’re interested in the new features that have been introduced in new versions of themes and Omeka S itself.
In my case, I eventually looked at the original changelog (what was different between my custom theme, and the version of the source theme it was based on), and re-implemented the changes starting from the latest version of the source theme.
This is, admittedly, time-consuming, but then you have your way open for the new goodies.
But if just updating the .ini does the trick for you, that’s of course the easiest.
One note: you mention:
and I see some different files, probably from modules that we installed.
But modules and themes are separate things, i.e. installing a module wouldn’t change anything in the theme folder (although, you may customise some parts of the theme to make use of module-specific features).
Yes. Our theme includes some custom CSS for things created by modules (Item Carousel Block and Timeline for example). It sounds like the path to those hasn’t changed though, so we should be fine.
It also has some custom blocks which are currently (v 3.x) in the view/common/block-layout directory. Based on how the Default theme looks, it looks like I will have to move them to a view/common/block-template directory for 4.x.
If the rest of the theming is the same across versions, than that is good news for me. I will test it out.
1 Like
For anyone else who stumbles across this post, you may have to do a little more than change the version in your .ini file.
In the 3.x versions, every page had a div with id “content” and inside that a div with class"blocks" where all the individual blocks live.
In 4.1, there is still the content div and the blocks div. But inside that, there is a new div with classes “blocks-inner” and “page-layout-normal”, which has all the individual blocks (and new blockGroups) inside of it.
tldr =
3.x → #content > .blocks > “everything”
4.1 → #content > .blocks > .blocks-inner.page-layout-normal > “everything”
So anything in your theme CSS like this will have to be changed to account for the extra div layer:
#content .blocks>div {
padding-top: 3.5rem;
padding-bottom: 3.5rem
}
I also did have to move some files from the block-layout directory to a block-template directory. That may depend on whether you use certain templates and/or the Block Plus module.