[Archivesspace_Users_Group] Advice on Custom Theming

Majewski, Steven Dennis (sdm7g) sdm7g at virginia.edu
Thu Sep 21 17:06:14 EDT 2017


I believe you are running into Rails defaults before the ASpace plugins come into play.


As I test, I added the line  'layout "custom"' to frontend/app/controllers/application_controller.rb.

It will then use layouts/custom.html.erb, and that layout appears  to work if that file is in either frontend/app/views/layouts/  or  plugins/local/frontend/views/layouts/ .


However, If I try moving the edited copy of application_controller.rb to the plugins/local/frontend/controllers/ directory, it no longer works as the default application controller is what the base class for all other controllers. Perhaps making the plugins extensible on this level would require adding a conditional check for plugin layouts in base application_controller .



Instead of deep mods, another possible way is patching it after the fact with javascript.

You could try adding something like the following  to plugins/local/frontend/views/layout_head.html.erb:



<script type="text/javascript">
  $( function() {
      $('.container-fluid').removeClass('container-fluid').addClass('container');
  });
</script>



-- Steve Majewski / UVA Alderman Library
________________________________
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Chelsea Lobdell <clobdel1 at swarthmore.edu>
Sent: Thursday, September 21, 2017 1:04:40 PM
To: Archivesspace Users Group
Subject: [Archivesspace_Users_Group] Advice on Custom Theming

Hi Archivesspace,

I'm looking for some advice on how to get started with custom theming. I've been reviewing this custom theming documentation:
https://github.com/archivesspace/archivesspace/blob/master/CUSTOMIZING_THEMING.md
[https://avatars0.githubusercontent.com/u/1311559?v=4&s=400]<https://github.com/archivesspace/archivesspace/blob/master/CUSTOMIZING_THEMING.md>

archivesspace/CUSTOMIZING_THEMING.md at master ...<https://github.com/archivesspace/archivesspace/blob/master/CUSTOMIZING_THEMING.md>
github.com
Customizing and Theming ArchivesSpace I just want to change some of the labels and messages! All the messages and labels are stored in locales files, which is part of ...




The initial change I'm trying to make is really simple. In layouts/application.html.erb I just need to change the header, navigation and maincontent from container-fluid to container to match the style of the other applications in our application suite.

My first attempt was to add archivesspace/plugins/local/frontend/views/layouts/application.html.erb and to make the appropriate changes. However, after a restart I am not seeing my changes. Can anyone advise me on how to get this working?

I also recognize that application.html.erb is a pretty important file to be customizing. If anybody has advice on how best to approach this, I would appreciate it.

- Chelsea
---------------
Chelsea Lobdell
Library Web Developer/ Swarthmore College
clobdel1 at swarthmore.edu<mailto:clobdel1 at swarthmore.edu> / (610)690-6818
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20170921/2bba3d47/attachment.html>


More information about the Archivesspace_Users_Group mailing list