MatthewKennedy/spree_pages

Add Pages menu to main menu

Closed this issue · 13 comments

Hi,
First of all thank you fro awesome extention. I have a question. How can I add Pages menu to main menu. It's not added automatically.

Thank for advise :D

Hi @zolzaya

I'll look into this now, just firing up a new fresh rails app.

Are you using this on its own or with the blogs extension?

@MatthewKennedy I using it with Action Text. I made some progress. I added following code to initializers/spree.rb

Spree::BackendConfiguration::CONFIGURATION_TABS << :pages

But it not IN the Configurations menu, It's IN the main menu. It's look like bug of Spree

I updated the extension as deface is not in Spree by default so the override was not being picked up.

@MatthewKennedy oh ok. I get another problem. When I set SpreePages::Config.use_action_text = true and I added Action Text with js, css. It's not display in new Page.

@MatthewKennedy should I add has_rich_text :content to Page model?

Hi @zolzaya

From the root of your app run: bin/rails action_text:install To install action text.

In:
your_app/vendor/assets/sytlessheets/spree/backend/all.css
Add at the top //= require actiontext

In:
your_app/vendor/assets/sytlessheets/spree/frontend/all.css
add at the top //= require actiontext

Additionally add this to application.rb:

    # Configs for action_text in Spree.
    config.action_view.sanitized_allowed_tags = ["strong", "em", "b", "i", "p", "pre", "hr", "br", "div", "span",
      "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "li", "a", "img",
      "blockquote"]

    config.action_view.sanitized_allowed_attributes = ["href", "src", "width", "height",
      "alt", "title", "class", "id", "name"]

@MatthewKennedy thanks for help. Already added but result is the same. I also run rails assets:clobber, rake tmp:clear and re-compile assets. But no luck :(

@MatthewKennedy I just found it. App says
ActionController::RoutingError (No route matches [GET] "/assets/spree/backend/trix/dist/trix"):
Where can I add it?

I added following code to actiontext.css NOT scss.
@import "trix/dist/trix";

OKay I just make it work. Thank for help @MatthewKennedy

I think also you need to add:

<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>

in the admin head to pull in the javascript.

I wish I had documented what I did.

@zolzaya
Bingo!!

Screenshot 2021-03-09 at 13 30 18

I'' add documentation now before I forget.

@MatthewKennedy please document it 💪💪💪

Hi @zolzaya

I have written a guide, if you want to take a look let me know if it works or not, and if I can make it any easier to understand