{"id":13778842,"url":"https://github.com/refinery/refinerycms-page-images","last_synced_at":"2025-05-15T05:06:43.879Z","repository":{"id":681202,"uuid":"962376","full_name":"refinery/refinerycms-page-images","owner":"refinery","description":"Adds an images tab to your pages so you can format a group of images really nicely on the frontend","archived":false,"fork":false,"pushed_at":"2025-01-03T05:16:57.000Z","size":483,"stargazers_count":104,"open_issues_count":13,"forks_count":120,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-10T10:09:55.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refinery.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-10-05T01:52:29.000Z","updated_at":"2025-01-03T05:16:54.000Z","dependencies_parsed_at":"2024-01-11T00:05:35.055Z","dependency_job_id":"ce8cf8f5-ecab-43aa-884a-b912f915db95","html_url":"https://github.com/refinery/refinerycms-page-images","commit_stats":{"total_commits":237,"total_committers":51,"mean_commits":4.647058823529412,"dds":0.7848101265822784,"last_synced_commit":"c0c4878bb692fa6e6926082ee9225d567fa763b0"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refinery%2Frefinerycms-page-images","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refinery%2Frefinerycms-page-images/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refinery%2Frefinerycms-page-images/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refinery%2Frefinerycms-page-images/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refinery","download_url":"https://codeload.github.com/refinery/refinerycms-page-images/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253814975,"owners_count":21968560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T18:00:58.094Z","updated_at":"2025-05-15T05:06:43.840Z","avatar_url":"https://github.com/refinery.png","language":"Ruby","funding_links":[],"categories":["Refinery team extensions"],"sub_categories":["Backoffice extensions"],"readme":"# Page Images Engine for Refinery CMS\n\n[![Build Status](https://travis-ci.org/refinery/refinerycms-page-images.svg?branch=master)](https://travis-ci.org/refinery/refinerycms-page-images)\n\n## About\n\nPage Images allows you to relate one or more images to any page in Refinery which makes it really easy for you to create simple image galleries with lightbox style popups on the front end page views.\n\n## Requirements\n\n* refinerycms-pages ~\u003e 4.0\n\n## Features\n\n* Ability to select one or more images from the image picker and assign them to a page\n* An image can be assigned to more than one page\n* Reordering support, simply drag into order\n* An image assigned to a page can have a caption.\n* An image's caption can be different for different pages\n\n## Install\n\nAdd this line to your application's `Gemfile`\n\n```ruby\ngem 'refinerycms-page-images', '~\u003e 4.0.0', git: \"https://github.com/refinery/refinerycms-page-images\", branch: \"master\"\n```\n\nNext run\n\n```bash\nbundle install\nrails generate refinery:page_images\nrake db:migrate\n```\n\nNow when you start up your Refinery application, edit a page and there should be a new \"Images\" tab.\n\n# Deploying to Heroku\n\nNote: the following information about assets on Heroku might be out of date.\n\nIn order to properly precompile assets on Heroku, config vars must be present in the environment during slug compilation.\n\n```bash\nheroku labs:enable user-env-compile -a myapp\n```\n\notherwise you may experience the following error:\n```\ncould not connect to server: Connection refused\nIs the server running on host \"127.0.0.1\" and accepting\nTCP/IP connections on port 5432?\n```\n\n\n[More Details](https://devcenter.heroku.com/articles/labs-user-env-compile)\n\n## Enable Captions\n\nYou can enable captions using an initializer containing the following configuration:\n\n```ruby\n# app/config/initializers/refinery/page-images.rb\nRefinery::PageImages.captions = true\n```\n\nBy default, captions are WYM editors. Prefer `textarea`s? Gotcha :\n\n```ruby\nRefinery::PageImages.wysiwyg = false\n```\n\nNote that WYMeditor support requires that you have the extension in your Gemfile:\n\n```ruby\ngem 'refinerycms-wymeditor', ['~\u003e 2.0', '\u003e= 2.0.0']\n```\n\n## Usage\n\n`app/views/refinery/pages/show.html.erb`\n\nIf you don't have this file then Refinery will be using its default. You can override this with\n\n```bash\nrake refinery:override view=refinery/pages/show\n```\n\nIf images have been assigned to a page several objects are available for showing on the page. They are\n\n* `@page.images`: A collection of images assigned to the page.\n* `@page.caption_for_image_index(i)` will return the caption (if any) for the i\u003csup\u003eth\u003c/sup\u003e image in @page.images\n* `@page.images_with_captions`: A collection of image_with_caption objects with the attributes image: and caption:\n\n```erb\n\u003c% content_for :body_content_right do %\u003e\n  \u003cul id='gallery'\u003e\n    \u003c% @page.images.each do |image| %\u003e\n      \u003cli\u003e\n        \u003c%= link_to image_tag(image.thumbnail(geometry: \"200x200#c\").url),\n                    image.thumbnail(geometry: \"900x600\").url %\u003e\n      \u003c/li\u003e\n   \u003c% end %\u003e\n  \u003c/ul\u003e\n\u003c% end %\u003e\n\u003c%= render :partial =\u003e \"/refinery/content_page\" %\u003e\n```\n\nIf you have enabled captions, you can show them like this\n\n```erb\n\u003c% content_for :body_content_right do %\u003e\n  \u003csection id='gallery'\u003e\n    \u003c% @page.images.each_with_index do |image, index| %\u003e\n      \u003cfigure\u003e\n        \u003c%= link_to image_tag(image.thumbnail(geometry: \"200x200#c\").url),\n                    image.thumbnail(geometry: \"900x600\").url %\u003e\n        \u003cfigcaption\u003e\u003c%=raw @page.caption_for_image_index(index) %\u003e\u003c/figcaption\u003e\n      \u003c/figure\u003e\n   \u003c% end %\u003e\n  \u003c/section\u003e\n\u003c% end %\u003e\n\u003c%= render :partial =\u003e \"/refinery/content_page\" %\u003e\n```\nor like this\n```erb\n\u003c% content_for :body_content_right do %\u003e\n  \u003csection id='gallery'\u003e\n    \u003c% @page.images_with_captions.each do |iwc| %\u003e\n      \u003cfigure\u003e\n        \u003c%= link_to image_tag(iwc.image.thumbnail(geometry: \"200x200#c\").url),\n                    iwc.image.thumbnail(geometry: \"900x600\").url %\u003e\n        \u003cfigcaption\u003e\u003c%=raw iwc.caption %\u003e\u003c/figcaption\u003e\n      \u003c/figure\u003e\n   \u003c% end %\u003e\n  \u003c/section\u003e\n\u003c% end %\u003e\n\u003c%= render :partial =\u003e \"/refinery/content_page\" %\u003e\n```\n## Refinerycms-blog support\n\nContrary to its name, `refinerycms-page-images` also works with `refinerycms-blog` and adds the functionality to link images to blog posts.\n\nIf `refinerycms-blog` is installed on your rails app, `refinerycms-page-images` will automatically detect it and perform the adequate initialization. PageImages are assigned to a polymorph \"page\" object, wich can be a `Refinery::Page` or a `Blog::Post`.\n\nThus, once installed, you can simply call a blog post's images the same way you'd call them for a page, like this\n\n```erb\n\u003c% @blog_posts.each do |blog_post| %\u003e\n  \u003cul id='gallery'\u003e\n    \u003c% blog_post.images.each do |image| %\u003e\n      \u003cli\u003e\n        \u003c%= link_to image_tag(image.thumbnail(geometry: \"200x200#c\").url),\n                    image.thumbnail(geometry: \"900x600\").url %\u003e\n      \u003c/li\u003e\n   \u003c% end %\u003e\n  \u003c/ul\u003e\n\u003c% end %\u003e\n\u003c%= render :partial =\u003e \"/refinery/content_page\" %\u003e\n```\n\n\n## Screenshot\n\n![Refinery CMS Page Images Screenshot](http://refinerycms.com/system/images/0000/1736/refinerycms-page-images.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefinery%2Frefinerycms-page-images","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefinery%2Frefinerycms-page-images","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefinery%2Frefinerycms-page-images/lists"}