by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 23 19:16
    mattpolito commented #892
  • Jun 12 00:01
    dam13n commented #907
  • May 12 13:30
    GBH closed #913
  • May 12 13:30
    GBH commented #913
  • May 12 02:04
    ScottyPcGuy-03 opened #913
  • Apr 27 22:59
    evgeniradev opened #912
  • Apr 17 04:50
    nitsujri commented #910
  • Apr 08 08:37
    stacytalbot commented #907
  • Apr 04 03:11
    GBH closed #873
  • Apr 04 03:10

    GBH on master

    fix seeds exporter (#911) Awes… (compare)

  • Apr 04 03:10
    GBH closed #911
  • Apr 03 18:50
    lopesrb synchronize #911
  • Apr 03 15:39
    lopesrb opened #911
  • Mar 30 09:50
    lopesrb commented #873
  • Mar 26 06:17
    echan00 edited #910
  • Mar 26 06:17
    echan00 opened #910
  • Mar 23 08:04
    chiubaka commented #906
  • Mar 11 18:43
    mdagraca opened #909
  • Mar 04 17:44
    lhjd opened #908
  • Feb 20 08:50
    kirichkov synchronize #905
Oleg
@GBH
Haven't tried it yet, but it should. There are no real differences between 5.2 and 6. Just a couple of new features.
Christian Aust
@datenimperator
Gentlemen, can I have something like {{ cms:helper some_helper, param_a, key: param_b }} in a layout? It renders to ERB but doesn't get evaluated. Should it?
Oleg
@GBH
That tag just renders <%= some_helper(foo, bar) %> and should be treated like anything else in the rails template. What exactly are you seeing?
Christian Aust
@datenimperator
@GBH sorry, my fault. I'm build some kind of single-page app where multiple pages are rendered into one, and I forgot to eventually render those subpages. Simply included the content_cache attribute which contains the ERB alright.
Michael Chaney
@mdchaney
Is there any way to redirect from a higher-level path to a lower-level path. In other words, I want to redirect /newsletter to /newsletter/2019/08. The redirect dropdown doesn't include the current path or anything in it.
Christian Aust
@datenimperator
@mdchaney I suppose that'd be easy using a Rails helper and the {{ cms:helper some_helper }} syntax within your top-level page. The helper would probably contain something like controller.redirect_to path.
Christian Aust
@datenimperator
I'd like to add files with metadata to a page, mp3 files in this case. Attachments hold a file reference only, what other way could you think of?
Michael Chaney
@mdchaney
@datenimperator I ended up simply creating a top level page called /newsletter-current that is a redirect set to the current newsletter. Then, /newsletter simply redirects to /newsletter-current. That works fine, although it is two redirects.
Peter Albertson
@petealbertson
What's the Comfy approved™ way to build a sitemap? I see there's a enable_sitemap flag in the repo, but I can't find any other information on where/how that's used.
I was looking into the rails sitemap gem but it requires the routes exist in routes.rb
Christian Aust
@datenimperator
@petealbertson from what I see the enable_sitemap isn't used in the code anymore. It had been added 8 years ago, maybe Comfy had sitemaps built in at that time? Having said that, the sitemap gem looks as if it could be used with Comfy. Then again, you could simply build a sitemap using standard Rails. See https://git.software-berater.net/christian/daemsing/commit/cee88439b221f3979e7a4c5a38bcf16b06436538 for an example.
Michael Chaney
@mdchaney
Here's how I did a sitemap. First, in config/routes:
get 'sitemap.xml' => 'main#sitemap', as: :sitemap
In my main_controller.rb file:
  def sitemap
    @cms_site = ::Comfy::Cms::Site.first
  end
Finally, app/views/main/sitemap.xml.builder:
xml.instruct! :xml, :version => '1.0', :encoding => 'UTF-8'

xml.urlset :xmlns => 'http://www.sitemaps.org/schemas/sitemap/0.9' do
  @cms_site.pages.published.each do |page|
    xml.url do
      xml.loc page.url
      # just take some guesses the closer to the root means higher priority
      # start subtracting 0.1 for every additional child page, max out at 0.1
      # "/" splits to 0, "/child_page" splits to 2, hence weird max -1 
      xml.priority [1 - (0.1 * ( ( [page.full_path.split("/").count, 1].max - 1 ) ) ), 0.1].max
      xml.lastmod page.updated_at.strftime('%Y-%m-%d')
    end
  end
  ['join', 'renew', 'login'].each do |path|
    xml.url do
      xml.loc "//#{@cms_site.hostname}/#{path}"
      xml.priority 1.0
      xml.lastmod Time.zone.local(2019, 7, 1, 0, 0, 0)
    end
  end
end
Note that /join, /renew, and /login are extra non-CMS paths that I am also adding.
Peter Albertson
@petealbertson
that's helpful, thank you @mdchaney, I'll give that a shot
Alexandra Grancho
@agrancho
Hello :) I have a snippet, let's call example_snippet with my navigation. I wanted to pass it their text variables in order to be able to edit them in the pages. I imagine that in the layout, something like this {{ cms:snippet example_snippet, text:variable_text }}
What I would like to do ideally is never make the user go and edit the text of a snippet inside its HTML structure (just to understand the issue)
Ghost
@ghost~5d7681ced73408ce4fca6d20
Hi there! Could anyone point me please at the wiki docs for version 1.12? Well, docs in any form, especially on tags. Thanks a bunch!
Morgan Aldridge
@morgant
we're running into errors when attaching images to file fragments: comfy/comfortable-mexican-sofa#898
Robert Head
@roberthead
How do we add a partial to page content? I have no trouble adding a partial to a layout or even to page content in a seed file, but I haven't had any success dropping {{ cms:partial 'my/widget' }} into any kind of field on a page.
chintansheth2001
@chintansheth2001
HI I want to create 404 page for cms how can I
chintansheth2001
@chintansheth2001
Okay I found this comfy/comfy-blog#57
Robert Head
@roberthead
When I use page.label and page.url in my menu , it's always in English, even if I18n.locale is something else. label and url don't take a locale, so I'm at a loss. How do I localize the menu?
Karol Topolski
@ktopolski
hello

I'm kinda new in the comfortable mexican sofa world and I encountered really weird bug on rails 6.0.1. It's connected to activestorage.

I installed activestorage and I tried to upload file via CMS. It shows empty progress bar, but in the server logs there's a loop on creating and deleting activestorage. There's no progress, just endless loop of create->delete. I'm kinda lost :(.

Thank you for creating this amazing gem and thank you for your time :)

Screen Shot 2019-11-20 at 13.49.51.png
Karol Topolski
@ktopolski
OK so I ended up uploading file via rails console and Comfy::Cms::File model. Saved with validate: false cause I had to skip file attribute presence validation. I attached manually to attachment.
Justin Gordon
@justin808
Hey everybody! Big thanks for the gem! It's awesome.
Big question: we click the <> to edit the HTML in a wysiwyg, and the data saves just fine. But then if we make any edit, even to a different field, the HTML source gets all sort of <p> tags and it's no longer html. Any ideas? Should I open an issue for this?
Oleg
@GBH
@justin808 Please make an issue. I'm guessing that Redactor is doing something weird, but who knows.
Justin Gordon
@justin808
@GBH the workaround is to only edit the HTML by adding attributes to the tags created by Redactor. My co-worker wanted to put a <style> block above the HTML. Are there any docs for what sort of limitations there are with editing the HTML?
Justin Gordon
@justin808

How can I see what user did what update? Is there some glue to the current_user?

2019-12-29_12-48-41.png

chintansheth2001
@chintansheth2001
how can I update WYSIWYG editor
Is there any document for that
Daniel
@chiubaka
Hello! Does anybody know if there's an option to disallow or sanitize <script> tags entered into the WSIWYG? I had an outside security review recently and they flagged this as problematic...
masanarih0ri
@masanarih0ri

I am a beginner developer.
I have been worried since yesterday. I have two pages that are content pages managed by this CMS (mexican-sofa).
https://example.com/interviews
https://example.com/seminars

I put these on the TOP page (https://example.com/
).
Is there a way to do that? I wrote the following code in application_controller using before_action
```

before_action :redirect_cms_pages

private
def redirect_cms_pages
redirect_cms_pages_list = ["/interviews", "/seminars"]
current_fullpath = request.fullpath
redirect_to '/' if redirect_cms_pages_list.include?(current_fullpath)
end

```

m.b.
@mbajur
hey there! is that technically possible to create a custom tag which accepts a block argument? So it's possible to do something like that: {{ gallery-row }} image tags {{ /gallery-row }}
Tom Aranda
@taranda
Is it possible to grant admin access on a page by page basis? I would like some administrators to be able to edit some pages in the site but not others. I am using CanCanCan and Devise. This is a major feature we are looking for.
thomaseude
@thomaseude
hey there, I have problem when I deploy on heroku my picture disappear 😢
Any tips for me ?
image.png
Peter Albertson
@petealbertson
image.png
I have a site with a lot of files and site admins need the ability to attach the same files somewhat often. I'm wondering if there's a reason why there's a limit on the ajax request for files in the redactor chooser?
This is from the files_controller.rb
Oleg
@GBH
I think because there's no pagination on that widget. Loading everything under the sun might be a bad idea.
Atulshukla8957
@Atulshukla8957
Hi Team,
I want to call {{ cms:page:events:event_grid }} as per parent on particular layout can someone suggest me best approach ?
Stanley Liu
@stanleypliu
hi @GBH, i'm upgrading an old app to use ActiveStorage instead of Paperclip, and have almost completely set it up by now, the only issue is that now the ActiveStorage routes are inaccessible as they come after the CMS routes in priority, so I tried using your config.railties_order fix, defining ActiveStorage::Engine first, but now helper methods in app/helpers aren't being imported properly so it breaks the website. perhaps it's in :all? i'm relatively new to Rails, so wanted to understand better how to solve it
Stanley Liu
@stanleypliu
never mind, i managed to solve it by putting setting the order [ActiveStorage::Engine, :main_app, :all] as shown
Matt Polito
@mattpolito
Hello all! Was wondering if anyone else is seeing a huge performance hit when going to a comfy page edit? It seems to be from building the page structure tree to populate the parent and redirect dropdowns.
Matt Polito
@mattpolito
I checked the issues/pr on github but didn't notice anyone else mentioning it so thought I'd pop in here to ask
Stanley Liu
@stanleypliu

wondering whether anyone has had experience with integrating PgSearch with CMS? prior to upgrading to CMS 2.0 this code worked to allow Comfy pages to be indexed:
`module FragmentSearch
extend ActiveSupport::Concern

included do
include PgSearch
multisearchable against: :content, if: -> (record) { record.identifier == "content" }
end
endtrying to launch the server constantly fails with unidentified method 'has_many_attached?' despite ActiveStorage being installed I tried include ActiveStorage::Attached::Macros` but the same message still appears. help is much appreciated. TIA