Skip to content

Instantly share code, notes, and snippets.

@mpathy
Last active September 15, 2026 06:10
Show Gist options
  • Select an option

  • Save mpathy/9e1367e8ec7bee7941d18c97e7b669c6 to your computer and use it in GitHub Desktop.

Select an option

Save mpathy/9e1367e8ec7bee7941d18c97e7b669c6 to your computer and use it in GitHub Desktop.
Koha OPAC Main Page Template for the NLP Workshops (with Google Maps and Facebook integration, just copy&paste into OpacMainUserBlock and modify it!)
<style>
/* The corrected layout grid */
.koha-start-container {
display: flex;
flex-wrap: wrap;
/* Ensures automatic wrapping on mobile devices */
justify-content: space-between;
/* Distributes the space between the blocks */
gap: 30px;
/* Space between Info and Facebook */
margin: 20px 0;
align-items: flex-start;
/* Align both blocks at the top */
}
/* The Information Box (Left) - allowed to shrink */
.koha-info-block {
flex: 1 1 400px;
/* Takes up remaining space, but never gets smaller than 400px */
flex-shrink: 1;
/* Allows this block to shrink */
background-color: #f9f9f9;
/* Subtle light gray */
padding: 30px;
border-radius: 8px;
/* Rounded corners */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
/* Light, modern shadow */
font-size: 16px;
}
.koha-info-block h2 {
margin-top: 0;
color: #2c3e50;
}
.koha-info-block h3 {
margin-top: 25px;
font-size: 18px;
border-bottom: 2px solid #e0e0e0;
padding-bottom: 5px;
color: #34495e;
}
.koha-info-block ul {
list-style: none;
padding: 0;
margin: 0;
}
.koha-info-block li {
margin-bottom: 12px;
}
/* The Facebook Box (Right) - FIXED width */
.koha-fb-block {
flex: 0 0 500px;
/* Stays strictly at exactly 500px */
flex-shrink: 0;
/* Prevents this block from shrinking */
width: 500px;
/* Secures the 500px width */
max-width: 100%;
/* Prevents overflowing the edge on mobile phones */
}
</style>
<div class="koha-start-container">
<!-- LEFT COLUMN: General Library Info -->
<div class="koha-info-block">
<h2>Welcome to YOUR LIBRARY NAME!</h2>
<p>We are delighted to welcome you to our online catalog (OPAC).
Here you can search our collection, reserve media, and manage your library account 24/7.</p>
<h3>πŸ•’ Opening Hours</h3>
<ul>
<li><strong>Monday:</strong> Closed</li>
<li><strong>Tuesday - Friday:</strong> 10:00 AM - 6:00 PM</li>
<li><strong>Saturday:</strong> 10:00 AM - 2:00 PM</li>
</ul>
<h3>πŸ“ž Contact & Service</h3>
<ul>
<li><strong>πŸ“ Address:</strong> Your physical address</li>
<li><strong>βœ‰οΈ Email:</strong> yourmailaddress@yourlibrary.com</li>
<li><strong>πŸ“ž Phone:</strong> +63 2 5336 7200</li>
</ul>
<h3>πŸ—ΊοΈ Library Location</h3>
<!--
===========================================================
GOOGLE MAPS IFRAME DOCUMENTATION & INSTRUCTIONS:
===========================================================
How to generate this code for your specific location:
1. Go to Google Maps (maps.google.com) in your browser.
2. Search for your library or enter the exact address.
(Îf both is not available in Google Maps, click on the point where it SHOULD be for 1 second, then the share button will appear anyways.)
3. Click the "Share" button in the left information panel.
4. In the pop-up window, select the "Embed a map" tab.
5. Click "Copy HTML".
6. Paste the code right below this comment block, but change width to width="100%"
IMPORTANT LAYOUT TIP:
Google Maps generates the code with fixed dimensions (e.g., width="600").
To ensure the map scales dynamically to fit this info box and mobile screens,
always overwrite the width value to width="100%". (unit: percentage)
You should leave the height as a fixed numerical value (e.g., "450") bigger numbers make it higher (unit: pixels)
===========================================================
-->
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3861.307396300633!2d120.97662847587429!3d14.581551877541292!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3397ca25a6e49a09%3A0x9227b7f6810d4bf!2sNational%20Library%20of%20the%20Philippines!5e0!3m2!1sen!2sph!4v1789450603553!5m2!1sen!2sph" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>
<!-- RIGHT COLUMN: Facebook SDK -->
<div class="koha-fb-block">
<!-- Facebook SDK Script -->
<!-- possible are all locale and language codes like tl_PH, en_PH, en_US, de_DE - depending on your audience -->
<!-- this code is found in the URL down below and important for the labelling of the UI elements like "Comment" -->
<div id="fb-root"></div>
<script async="" defer="defer" crossorigin="anonymous" src="https://connect.facebook.net/tl_PH/sdk.js#xfbml=1&amp;version=v18.0"></script>
<!--
===========================================================
FACEBOOK WIDGET OPTIONS DOCUMENTATION:
===========================================================
data-href: URL of the Facebook page you want to embed.
data-tabs: Tabs to render. Options: 'timeline', 'events', 'messages'.
You can combine them using commas (e.g. "timeline,events").
data-width: Width of the widget in pixels. Max allowed by Facebook is 500, min is 180.
data-height: Height of the widget in pixels. (e.g., 1000 for a taller view without scrolling).
data-small-header: 'true' to use a smaller version of the page header, 'false' for default.
data-adapt-container-width:'true' ensures the widget scales down on smaller mobile screens.
data-hide-cover: 'true' to completely hide the page's cover photo in the header.
data-show-facepile: 'true' to show profile pictures of friends who like the page, 'false' to hide them.
===========================================================
-->
<!-- FACEBOOK WIDGET -->
<!-- edit entries as shown above. the BLOCKQUOUTE is important if the Facebook Page Content can not be shown as a fallback. -->
<!-- it will be shown instead, so please also change the URL on all three occurences! (here: https://www.facebook.com/NLP1887) -->
<div class="fb-page"
data-href="https://www.facebook.com/NLP1887"
data-tabs="timeline"
data-width="500"
data-height="1000"
data-small-header="false"
data-adapt-container-width="true"
data-hide-cover="false"
data-show-facepile="false">
<blockquote cite="https://www.facebook.com/NLP1887" class="fb-xfbml-parse-ignore">
<a href="https://www.facebook.com/NLP1887">National Library of the Philippines on Facebook</a>
</blockquote>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment