refinerycms-pages 0.9.9.3 → 0.9.9.4
Sign up to get free protection for your applications and to get access to all the features.
- data/app/models/page.rb +6 -1
- data/license.md +1 -1
- data/refinerycms-pages.gemspec +3 -4
- metadata +3 -4
- data/readme.md +0 -156
data/app/models/page.rb
CHANGED
@@ -172,7 +172,12 @@ class Page < ActiveRecord::Base
|
|
172
172
|
end
|
173
173
|
|
174
174
|
def cache_key
|
175
|
-
|
175
|
+
if defined?(::Refinery::I18n) and ::Refinery::I18n.enabled?
|
176
|
+
[Refinery.base_cache_key, ::I18n.locale ,super].join('/')
|
177
|
+
else
|
178
|
+
[Refinery.base_cache_key, super].join('/')
|
179
|
+
end
|
180
|
+
|
176
181
|
end
|
177
182
|
|
178
183
|
# Returns true if this page is "published"
|
data/license.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# MIT License
|
2
2
|
|
3
|
-
Copyright (c) 2005-
|
3
|
+
Copyright (c) 2005-2011 [Resolve Digital](http://www.resolvedigital.com)
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/refinerycms-pages.gemspec
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{refinerycms-pages}
|
5
|
-
s.version = %q{0.9.9.
|
5
|
+
s.version = %q{0.9.9.4}
|
6
6
|
s.summary = %q{Pages engine for Refinery CMS}
|
7
7
|
s.description = %q{The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.}
|
8
|
-
s.date = %q{2011-02-
|
8
|
+
s.date = %q{2011-02-24}
|
9
9
|
s.email = %q{info@refinerycms.com}
|
10
10
|
s.homepage = %q{http://refinerycms.com}
|
11
11
|
s.rubyforge_project = %q{refinerycms}
|
@@ -99,12 +99,11 @@ Gem::Specification.new do |s|
|
|
99
99
|
'lib/pages/tabs.rb',
|
100
100
|
'lib/refinerycms-pages.rb',
|
101
101
|
'license.md',
|
102
|
-
'readme.md',
|
103
102
|
'refinerycms-pages.gemspec',
|
104
103
|
'spec',
|
105
104
|
'spec/models',
|
106
105
|
'spec/models/page_spec.rb'
|
107
106
|
]
|
108
107
|
|
109
|
-
s.add_dependency 'refinerycms-core', '~> 0.9.9.
|
108
|
+
s.add_dependency 'refinerycms-core', '~> 0.9.9.4'
|
110
109
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: refinerycms-pages
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.9.9.
|
5
|
+
version: 0.9.9.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Resolve Digital
|
@@ -13,7 +13,7 @@ autorequire:
|
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
15
|
|
16
|
-
date: 2011-02-
|
16
|
+
date: 2011-02-24 00:00:00 +13:00
|
17
17
|
default_executable:
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
requirements:
|
25
25
|
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.9.9.
|
27
|
+
version: 0.9.9.4
|
28
28
|
type: :runtime
|
29
29
|
version_requirements: *id001
|
30
30
|
description: The default content engine of Refinery CMS. This engine handles the administration and display of user-editable pages.
|
@@ -98,7 +98,6 @@ files:
|
|
98
98
|
- lib/pages/tabs.rb
|
99
99
|
- lib/refinerycms-pages.rb
|
100
100
|
- license.md
|
101
|
-
- readme.md
|
102
101
|
- refinerycms-pages.gemspec
|
103
102
|
- spec/models/page_spec.rb
|
104
103
|
has_rdoc: true
|
data/readme.md
DELETED
@@ -1,156 +0,0 @@
|
|
1
|
-
# Pages
|
2
|
-
|
3
|
-
![Refinery Pages](http://refinerycms.com/system/images/0000/0656/pages.png)
|
4
|
-
|
5
|
-
## About
|
6
|
-
|
7
|
-
One core part of Refinery is Pages. Plugins such as News and Inquiries hook to pages. The menu is rendered based off the structure of your pages.
|
8
|
-
|
9
|
-
Pages have one key thing about them that is unique - page parts.
|
10
|
-
|
11
|
-
## Page Parts
|
12
|
-
|
13
|
-
![Refinery Page Parts](http://refinerycms.com/system/images/0000/0586/editing-page.png)
|
14
|
-
|
15
|
-
### What are they?
|
16
|
-
|
17
|
-
Think of a page part is a single piece of content on your page. At [Resolve Digital](http://www.resolvedigital.com) we often simply use ``body`` and ``side_body``. One is for the main content and one is for the content which goes on a side bit of the page to display other information.
|
18
|
-
|
19
|
-
### Default Page Parts
|
20
|
-
|
21
|
-
You can change what the default page parts are called or add more by editing the "Default Page Parts" setting. This is a serialized array of names. The default looks like this
|
22
|
-
|
23
|
-
---
|
24
|
-
- Body
|
25
|
-
- Side Body
|
26
|
-
|
27
|
-
Edit this setting to suit your taste.
|
28
|
-
|
29
|
-
### Adding Page Parts for Specific Pages
|
30
|
-
|
31
|
-
You can add extra page parts to your pages by setting the "New Page Parts" to ``true``.
|
32
|
-
|
33
|
-
Now do this
|
34
|
-
|
35
|
-
* Edit the page you want to add a part to
|
36
|
-
* Click the little "+" icon up by the page part tabs
|
37
|
-
* Type the name of your new part and hit add.
|
38
|
-
|
39
|
-
_Note: in the user-facing front end we call them "content sections" not "page parts"._
|
40
|
-
|
41
|
-
## Page Options
|
42
|
-
|
43
|
-
### Draft/Published
|
44
|
-
|
45
|
-
You can have draft and published pages. This is controlled by checking and unchecking the "Save as Draft" field on the page form, when editing the page.
|
46
|
-
|
47
|
-
### Custom Title
|
48
|
-
|
49
|
-
There are three options for how the page title will be rendered on the front end.
|
50
|
-
|
51
|
-
* ``None``: will just default to the page title
|
52
|
-
* ``Text``: allows you to have a different name for the page in the backend to the front end (sometimes good for SEO)
|
53
|
-
* ``Image``: If your designer is using a custom non-standard web font, this is ideal. Bang the image of your title right in there (_we don't recommend this though! Standard web fonts are always a good idea_)
|
54
|
-
|
55
|
-
### Show in Menu
|
56
|
-
|
57
|
-
You can hide a page from the navigation if you like by unchecking "show in menu". This is good for extra reference pages or even pages you might want to link someone up to directly but not "advertise" the pages existence on the menu.
|
58
|
-
|
59
|
-
### Custom URL
|
60
|
-
|
61
|
-
This allows you to make your page not link to a normal page but make it show something else. This could be a donation link to a completely different site or as Refinery uses it, you might want to link to another plugin.
|
62
|
-
|
63
|
-
The "contact us" page for example has a Custom URL of ``/contact``, this is because we want it to load the inquiries form from the inquiries plugin instead and we have this ``match '/contact', :to => 'inquiries#new', :as => 'new_inquiry'`` in the routes.
|
64
|
-
|
65
|
-
### WYMeditor (the visual editor)
|
66
|
-
|
67
|
-
Refinery is backed by [WYMeditor](http://www.wymeditor.org/)
|
68
|
-
|
69
|
-
It's a standards compliant editor that we've trimmed to only have what we feel is absolutely necessary. When you're editing the content in a page part you're using [WYMeditor](http://www.wymeditor.org/).
|
70
|
-
|
71
|
-
We have since modified the source code of WYMeditor to allow for a lot of new features like our custom dialogues however it is all based on the release: WYMeditor 0.5 rc1.
|
72
|
-
|
73
|
-
You can also switch to "source" view and edit XHTML manually if the visual editor is not playing nice.
|
74
|
-
|
75
|
-
### Custom Selectable Styles in WYMeditor
|
76
|
-
|
77
|
-
![Refinery Page Editor Styles](http://refinerycms.com/system/images/0000/0596/editing-page-style.png)
|
78
|
-
|
79
|
-
Some sites require a little more than just your standard bold and heading controls. This is where the "css" style drop down comes in handy.
|
80
|
-
|
81
|
-
It allows your users to select a style you define. You need to edit/create a CSS file called ``theme.css``.
|
82
|
-
|
83
|
-
This file should be located in ``/public/stylesheets/themes.css``
|
84
|
-
|
85
|
-
Inside that file you define your styles like this
|
86
|
-
|
87
|
-
.category-name-style-name {
|
88
|
-
// apply your CSS rules here
|
89
|
-
}
|
90
|
-
|
91
|
-
For example, if I wanted to add a style that allowed my users to highlight their text a light yellow colour, I would put this
|
92
|
-
|
93
|
-
.text-highlight-yellow {
|
94
|
-
background: LightYellow;
|
95
|
-
}
|
96
|
-
|
97
|
-
Now edit ``public/javascripts/admin.js``. We're going to need to tell WYMeditor that we have some new styles it should load when the editor is loaded.
|
98
|
-
|
99
|
-
Currently your ``admin.js`` file will have something like this
|
100
|
-
|
101
|
-
var custom_wymeditor_boot_options = {
|
102
|
-
|
103
|
-
};
|
104
|
-
|
105
|
-
If we open ``public/javascripts/boot_wym.js`` we can see this inside which is the default:
|
106
|
-
|
107
|
-
, classesItems: [
|
108
|
-
{name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}
|
109
|
-
, {name: 'image-align', rules:['left', 'right'], join: '-'}
|
110
|
-
, {name: 'font-size', rules:['small', 'normal', 'large'], join: '-'}
|
111
|
-
]
|
112
|
-
|
113
|
-
Let's just breakdown a single WYMeditor line and understand it:
|
114
|
-
|
115
|
-
{name: 'font-size', rules:['small','normal','large'], join: '-'}
|
116
|
-
|
117
|
-
``font-size`` is the name of the category and ``small``, ``normal``, ``large`` are the actual styles. So for this to match up with the styles in my theme.css file the class name has to be:
|
118
|
-
|
119
|
-
.font-size-small { // CSS rules here }
|
120
|
-
.font-size-normal { // CSS rules here }
|
121
|
-
.font-size-large { // CSS rules here }
|
122
|
-
|
123
|
-
So going back to our text highlighting style above, we make the new style show up in the editor by changing our ``admin.js`` file to:
|
124
|
-
|
125
|
-
var custom_wymeditor_boot_options = {
|
126
|
-
classesItems: [
|
127
|
-
{name: 'text-align', rules:['left', 'center', 'right', 'justify'], join: '-'}
|
128
|
-
, {name: 'image-align', rules:['left', 'right'], join: '-'}
|
129
|
-
, {name: 'font-size', rules:['small','normal','large'], join: '-'}
|
130
|
-
, {name: 'text-highlight', rules:['yellow'], join: '-'}
|
131
|
-
]
|
132
|
-
}
|
133
|
-
|
134
|
-
### Dialogs that show from WYMeditor
|
135
|
-
|
136
|
-
![Refinery Page Editor Link Dialog](http://refinerycms.com/system/images/0000/0636/link-dialog.png)
|
137
|
-
|
138
|
-
## Page Link dialog
|
139
|
-
|
140
|
-
The link dialog lets you link in several different ways:
|
141
|
-
|
142
|
-
* To an internal page
|
143
|
-
* To an external page
|
144
|
-
* To an email address
|
145
|
-
* To a resource you've uploaded in the Resources tab.
|
146
|
-
|
147
|
-
## Insert Image dialog
|
148
|
-
|
149
|
-
Simply lets you select from an existing image found in the Images tab or upload a new one right within the dialog.
|
150
|
-
|
151
|
-
## Refinery Default Pages
|
152
|
-
|
153
|
-
Some pages you have to keep in order for Refinery to stay fully functional:
|
154
|
-
|
155
|
-
* Home page - the page that has ``link_url`` to ``root_url`` (normally /)
|
156
|
-
* Page not found - the default 404 page
|