Comments (6)
Hi @darcemac!
That sounds strange - if you've followed the instructions at https://github.com/withassociates/slices/wiki/Creating-Slices all should be well - note that you need to restart your Rails server after creating a new Slice for it to show up!
Do you have some code from your problem Slices that you could share?
from slices.
Hey @calumgunn!
Thanks for the response, I appreciate it! I'm new to rails having mostly developed in php/wordpress and a couple of sites in jekyll so I made a rookie mistake of not thinking about the server restart, thanks for pointing that out. I'm able to add slices to the 'containers' easy now, its a great system, much easier than my experience with WP plugin Advanced Custom Fields.
I have another question sorry, I've added a slice called 'Images' using an example I found here - https://github.com/thomasmarshall/example-slices but I cant get the images to appear in the page default page view, results in empty
Thanks for your help.
from slices.
Hi @darcemac
Could you post a snippet of your template?
from slices.
Hi @jgwhite,
Ok here is the main layout and the image slice view, template etc. I haven't modified them.
default.html.rb
<body class="layout-default">
<section id="main" role="main">
<%= container "content" %>
</section>
</body>
images_slice.rb
class ImagesSlice < Slice
include Slices::HasAttachments
class Image < Attachment
field :link, type: String
field :caption, type: String
end
has_attachments :images, class_name: 'ImagesSlice::Image'
end
images.hbs
<li>
{{#attachmentComposer field="images"}}
<textarea name="caption" placeholder="Caption…" rows="8">{{caption}}</textarea>
<!--<input type="text" name="link" placeholder="Link…" value="{{link}}">-->
{{/attachmentComposer}}
</li>
show.html.erb
<div class="slice images-slice">
<ul class="images">
<% slice.images.each do |image| %>
<li>
<%= link_image_if_linkable image.link, image.asset, :original %>
<div class="image-caption"><%= markdown image.caption %></div>
</li>
<% end %>
</ul>
</div>
Admin home page with images uploaded
I basically want to use an Open Source Rails CMS with functionality to have multiple custom fields for content and multiple images, blog etc. I really like the way in Slices provides this but it may be a bit beyond me at this point in my Rails journey :)
I appreciate your help!
from slices.
Hmm… the code all looks correct. Might be best to do a screen share. We have some slots available here: http://pair.withassociates.com
We can arrange a time that works best for you if none of those suit.
from slices.
Hi @jgwhite,
I really don't want to waste your time any further as I'm just having a play to assess another CMS option and I imagine you guys are under the pump doing work.
It might be that I've installed it wrong... though I followed the README.md on https://github.com/withassociates/slices.
If you had an example of a base Slices CMS project with images, posts etc. that I could download, I can have at look how its setup...
Thanks again.
from slices.
Related Issues (20)
- Handle permalink being an empty string in path_from_attributes
- [RFC] Slice Linting HOT 5
- [RFC] Fragment caching HOT 1
- [RFC] Allow users to opt-out of Entry templates
- Cannot POST to /
- Page preview for the homepage
- Better messaging around auth
- Upgrade analytics HOT 4
- NotImplementedError in Admin::SiteMapsController#index HOT 5
- Improve recording of exceptions
- `Slices::Config.google_apps_domain` should be removed HOT 1
- Don't redirect to sitemap on Mongoid::Errors::DocumentNotFound HOT 1
- Images only rendering at admin size, not original HOT 2
- Can't currently host Slices for free on Heroku HOT 1
- Link to next and previous page from current page HOT 2
- [RFC] Replace wiki with in-repo guides HOT 4
- `Admin#super_user?` is not checked server-side
- Search terms need escaping before passing into regexps
- Show time zone in date picker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slices.