Coder Social home page Coder Social logo

sambelmor / solidus_slider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jtapia/solidus_slider

0.0 1.0 0.0 13.32 MB

A Solidus extension to add sliders

License: BSD 3-Clause "New" or "Revised" License

Ruby 53.58% JavaScript 4.70% HTML 41.72%

solidus_slider's Introduction

Solidus Slider

Build Status
Credit to https://github.com/samanmohamadi/solidus_slider

Basic Overview

Add a slider to the homepage of your Solidus site, and manage the slide show from within the Admin panel.

Setup

Add this extension to your Gemfile:

gem 'solidus_slider', github: 'jtapia/solidus_slider'

Then run:

bundle exec rails g solidus_slider:install

Using the slider

Spree 3 uses the bootstrap framework and a default slider template is available for bootstrap 3 spree/shared/_slider.html.erb.

Example usage:

  <%= render partial: 'spree/shared/slider', locals: { slider: Spree::Slide.published, cid: 'home' } %>

If you desire to have a customized carousel template you can specify your own like so:

<% if Spree::Slide.published.count > 0 %>
  <section id="slideshow">
    <ul class="slide">
      <% Spree::Slide.published.order('position ASC').each do |s| %>
        <li>
          <h1><%= s.slide_caption %></h1>
          <%= link_to image_tag(s.slide_image.url), url_for(s.link_url) %>
        </li>
      <% end %>
    </ul>
    <a title="<%= t(:previous) %>" class="slider-prev"><%= t(:previous)%></a>
    <a title="<%= t(:next) %>" class="slider-next"><%= t(:next) %></a>
  </section>
<% end %>

Dynamic content management

To add dynamic content, go to the spree admin section, under 'Configuration' and find the Solidus Slider & Solidus Slider Locations menu.

You can create new slides and new locations. Then to fetch & render the slider for a particular location you can do the following:

  <% slides = Spree::Slide.published.location("home") %>
  <%= render partial: 'spree/shared/slider', locals: { slider: slides } %>

Updates

  • Add ability to find slide locations via autocomplete(Admin)
  • Update views(Admin)
  • Update model relations

solidus_slider's People

Contributors

priviterag avatar jspizziri avatar samanmohamadi avatar johanb avatar iloveitaly avatar zewelor avatar gudata avatar joshuapaling avatar garpit avatar sfcgeorge avatar jdutil avatar stevenbarragan avatar mjc avatar jtapia avatar jsqu99 avatar kraken-ua avatar factor4 avatar rupix avatar kao avatar daemonsy avatar berkes avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.