[Archivesspace_Users_Group] assistance request: custom CSS self hosted site

Majewski, Steven Dennis (sdm7g) sdm7g at eservices.virginia.edu
Tue Nov 1 11:42:53 EDT 2016


It would help if you would be more specific about what you tried and where it failed, or what exactly doesn’t make sense.

[1] Did you try adding a layout_head.html.erb file to local plugins as described:

http://archivesspace.github.io/archivesspace/user/customizing-and-theming-archivesspace/#I-just-want-to-add-a-few-CSS-rules!!!

[2] You should be able to web browser’s debugger to see if your added css file is among loaded resources.

[3] Is the problem than that the css isn’t getting applied ?
    If you’re using standard bootstrap classes for your selectors, then it may be a css precedence issue,
    and browser debugger should be able to indicate that.
    If you’re using your own classes and ids in selectors, then maybe what you’re trying to figure out is how to tag items with those classes. You may need to modify other views to do that. You’re probably better off working with bootstrap if possible.

( [4] Or are you having trouble with the .erb template syntax ? )


An example (a bit more about javascript than css, but may help anyway) : adding support for diva.js IIIF image viewer for digital objects file_versions:


plugins/local/frontend/views/layout_head.html.erb:
=====
<!--  diva.js support: meta referrer is required by iiif.lib service to display unpublished images  -->
<meta name="referrer" content="origin" />
<meta name="controller" content="<%= controller.controller_name %>" />
  <% if controller.controller_name == 'digital_objects' %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/diva.js/4.1.0/css/diva.min.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/diva.js/4.1.0/js/diva.min.js"></script>
<script type="text/javascript">
function showDiva( obj ) {
    // alert( obj.href );  // debug
    $('#diva-wrapper').diva({
        objectData: obj.href,
        // Other options can be set here as well - see the Settings wiki page
        enableIIIFMetadata: true,
        zoomLevel: 1,
        inGrid: true,
        inBookLayout: false,
    });
    return false;
}
</script>
<% end %>



======
and file_versions/_show.html.erb copied from frontend/app/views and modified to add a div with id=“diva-wrapper” to match the jQuery selector above:
======


diff  frontend/app/views/file_versions/_show.html.erb plugins/local/frontend/views/file_versions/_show.html.erb
9c9
<       <div class="panel panel-default">
---
>       <div class="panel panel-default" >
26c26
<             <%= render_aspace_partial :partial => "file_versions/file_uri", :locals => {:file_uri => uri_or_string( file_version['file_uri'] ) } %>
---
>             <%= render_aspace_partial :partial => "file_versions/file_uri", :locals => {:file_uri => URI( file_version['file_uri'] ) } %>
28a29
>           <div id="diva-wrapper"></div>







On Nov 1, 2016, at 10:38 AM, Nathan Hosburgh <NHOSBURGH at Rollins.edu<mailto:NHOSBURGH at rollins.edu>> wrote:

Hi,

We have been attempting to apply some CSS changes to AS and spinning our wheels due to a lack of understanding of the logic of AS, plugins, etc.

If there is someone out there who is self-hosted on AS and has applied custom CSS to their public AS site, please reach out if you are willing to assist.  If anyone has created step by step instructions, that would also be great.

Basically, we have our custom CSS ready to go and I’m trying to figure out how to actually apply it as AS is different than any other web app we’ve used before.  My web developer and I have looked at the documentation here<http://archivesspace.github.io/archivesspace/user/customizing-and-theming-archivesspace/> but it just doesn’t make sense to us.

Thanks
Nate

Nathan Hosburgh
Discovery & Systems Librarian
Rollins College, Olin Library
1000 Holt Avenue
Winter Park, FL 32789
nhosburgh at rollins.edu<mailto:nhosburgh at rollins.edu>
(407) 691-1157

http://rollins.academia.edu/NathanHosburgh

“If you would tell me the heart of a man, tell me not what he reads, but what he rereads.” ― François Mauriac

_______________________________________________
Archivesspace_Users_Group mailing list
Archivesspace_Users_Group at lyralists.lyrasis.org<mailto:Archivesspace_Users_Group at lyralists.lyrasis.org>
http://lyralists.lyrasis.org/mailman/listinfo/archivesspace_users_group

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20161101/7e1399ac/attachment.html>


More information about the Archivesspace_Users_Group mailing list