Module: Pages

rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sun, 2011-06-12 06:27

Pages is a module for Gallery 3 that allows admins to add static pages to their Gallery's that contain various types of information. This is similar to other modules, such as About or Services except that instead of creating a single page, it allows for any number of pages to be created.

This module includes an optional sidebar block that contains a list of links to each page. Alternately, users could use other modules such as Code block to create a custom sidebar. Each page also has an option on the Create/Edit page screen to add a link to the page into Gallery's menu. Links to pages could also be manually inserted into the header/footer text via the Admin->Appearance->Theme Options menu or by creating a custom theme.

The initial release of this module has been tested with Gallery 3.0.2. The WYSIWYG HTML Editor used for creating / editing pages has been tested using Google Chrome 12.0.742.91, Firefox 4.0.1 and Internet Explorer 8.0.7600.16385.

---
Report Problems/Suggestions Here | Get latest version | Documentation | Coffee Fund | My Library | My GitHub

AttachmentSize
pages.zip36.3 KB
 
heydroid

Joined: 2003-09-29
Posts: 48
Posted: Sun, 2011-06-12 16:04

Thank you! I have been waiting for a module like this.
Now I just need to find a way to have a gallery item link to a page.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sun, 2011-06-12 17:51
heydroid wrote:
Now I just need to find a way to have a gallery item link to a page.

How would this work? You'd upload a photo or create an album and then the user clicks on it and gets redirected to a different page? Or did you have something else in mind?

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-06-13 00:54

Useful module, thanks! I wish it had been around a while back. One problem with using it in conjunction with Menu Links is that you can only add two new menu items IIRC. Personally I'd like a little more control over the menu.

 
heydroid

Joined: 2003-09-29
Posts: 48
Posted: Mon, 2011-06-13 01:37
Quote:
How would this work? You'd upload a photo or create an album and then the user clicks on it and gets redirected to a different page? Or did you have something else in mind?

Just like this did: http://codex.gallery2.org/Gallery2:Modules:linkitem
Basically, you could add an item to an album, upload a thumbnail, and have it link to an url.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2011-06-13 03:49
undagiga wrote:
Useful module, thanks! I wish it had been around a while back. One problem with using it in conjunction with Menu Links is that you can only add two new menu items IIRC. Personally I'd like a little more control over the menu.

Personally I don't like to put stuff in the menu, there's just too little space for a large number of pages, but I guess I could add a checkbox or something to the page creation screen for showing the pages link in the menu.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2011-06-13 03:52
heydroid wrote:
Quote:
How would this work? You'd upload a photo or create an album and then the user clicks on it and gets redirected to a different page? Or did you have something else in mind?

Just like this did: http://codex.gallery2.org/Gallery2:Modules:linkitem
Basically, you could add an item to an album, upload a thumbnail, and have it link to an url.

G3 doesn't really support custom item types, but what I could probably do is set something up where you upload a photo and then select Edit photo and enter in a URL. Then whenever the photo page loads, it would redirect to the URL instead of displaying the photo. This might be a better idea for a separate module rather then a feature for Pages though.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-06-13 04:03
Quote:
This might be a better idea for a separate module rather then a feature for Pages though.

A much wanted module.
Keep up the great work, you module generating machine. :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-06-13 04:05
rWatcher wrote:
Personally I don't like to put stuff in the menu, there's just too little space for a large number of pages.

I know what you mean, but I also feel the same about the sidebar, which I think can quickly become cluttered. My view is that the sidebar looks like it relates to the current page rather than the whole site, whereas the menu is the more obvious place for whole-of-gallery links.

I also wonder just how much attention people really pay to the sidebar, as since I moved the "Facebook Like" text from the sidebar to under the images it's been used a lot more.

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Mon, 2011-06-13 04:06
floridave wrote:
Keep up the great work, you module generating machine. :-)

+1

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2011-06-13 04:21
heydroid wrote:
Quote:
How would this work? You'd upload a photo or create an album and then the user clicks on it and gets redirected to a different page? Or did you have something else in mind?

Just like this did: http://codex.gallery2.org/Gallery2:Modules:linkitem
Basically, you could add an item to an album, upload a thumbnail, and have it link to an url.

floridave wrote:
Quote:
This might be a better idea for a separate module rather then a feature for Pages though.

A much wanted module.
Keep up the great work, you module generating machine. :-)

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

Okay, here you go:
http://gallery.menalto.com/node/102548

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2011-06-22 05:20

Here is the updated version of the Pages module -- When creating or editing a page, there is now an option to display a link to the page in the menu, after the home link.

 
waterbeek

Joined: 2009-07-19
Posts: 1
Posted: Wed, 2011-06-15 18:44

Great !!! it works okey.
THANKS

 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Thu, 2011-06-16 16:37

This looks great to me as well as I want to use a number of static pages on the menu.
Very minor point, the edit box is a tad on the small side, it's a bit like keyhole surgery when working on a large page :-)

Also the "insert lists" display fine in the edit view but not at all in the menu page. Is this a limitation in HTML Purifier rather than the Pages module?
Many thanks.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Fri, 2011-06-17 04:57
zjohn13 wrote:
This looks great to me as well as I want to use a number of static pages on the menu.
Very minor point, the edit box is a tad on the small side, it's a bit like keyhole surgery when working on a large page :-)

That's the default size for a textbox. I'll have to see if I can tweak the CSS or something.

zjohn13 wrote:
Also the "insert lists" display fine in the edit view but not at all in the menu page. Is this a limitation in HTML Purifier rather than the Pages module?
Many thanks.

Neither. If you're using Wind (and probably other themes), the CSS is set to _not_ display bullets/numbers on lists, you'll have to insert some custom style codes to make it display right. Probably something like this would work:
<ol><li style="list-style-type:circle;">123</li><li style="list-style-type:circle;">456</li><li style="list-style-type:circle;">789</li></ol>

 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Sat, 2011-06-18 08:37

Thanks for your suggestion to get bullet points to work, I'll have a go at that.
I guess this feature has been set to not display for a reason but there's most probably quite a few users like me who want to provide a number of detailed static information pages where layout and formating is important (second that is to the excellent display of photos :-) ). The Pages module is a big step forwards in this area.

Now if only the menu had drop down lists of other static page selections my happiness would be complete.......

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sat, 2011-06-18 17:29
zjohn13 wrote:
Thanks for your suggestion to get bullet points to work, I'll have a go at that.
I guess this feature has been set to not display for a reason but there's most probably quite a few users like me who want to provide a number of detailed static information pages where layout and formating is important (second that is to the excellent display of photos :-) ). The Pages module is a big step forwards in this area.

The wind theme uses lists for all sorts of things -- the login and search fields at the top of the page, the menu, various sidebar modules, etc (look through the source code for any given page and see). Showing numbers or bullets next to each menu option would look a bit weird, so I guess that's why it's disabled.

zjohn13 wrote:
Now if only the menu had drop down lists of other static page selections my happiness would be complete.......

There is already an option to display links to individual static pages in the top menu, but I assume that's not what you're looking for. What exactly did you have in mind here?

 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Sun, 2011-06-19 06:30
Quote:
The wind theme uses lists for all sorts of things -- the login and search fields at the top of the page, the menu, various sidebar modules, etc (look through the source code for any given page and see). Showing numbers or bullets next to each menu option would look a bit weird, so I guess that's why it's disabled.

Thanks for the explanation, it helps me to get a handle on how this system works.

Quote:
There is already an option to display links to individual static pages in the top menu, but I assume that's not what you're looking for. What exactly did you have in mind here?

I'm using the Clean Canvas theme and want to display about a dozen static pages.
The Pages module would enable me to achieve this but after six or seven pages have been added to the menu, the menu starts to overlay the search box.
Adding further pages obliterates the search box and wraps the menu on to a second line.
It would be neater to display less Pages in the menu and to enable the Pages menu items to work like admin menu items.
When you hover over one of the Page menus a drop down Page list appears for selection.
Maybe a bridge to far?

 
fotoron

Joined: 2010-04-25
Posts: 32
Posted: Sun, 2011-06-19 08:05

An option to hide the sidebar would be nice (like the about module). It gives users full-width blank 'Pages' to work with.

--

  • My Gallery
  • 3.0.2 (Coollanta) - Grey Dragon Theme 3.0.8 (carbon custom)
 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Sun, 2011-06-19 13:02

Regular GreyDragon already has this option in "Admin | Appearance | Theme Options".

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Sun, 2011-06-19 19:14
zjohn13 wrote:
I'm using the Clean Canvas theme and want to display about a dozen static pages.
The Pages module would enable me to achieve this but after six or seven pages have been added to the menu, the menu starts to overlay the search box.
Adding further pages obliterates the search box and wraps the menu on to a second line.
It would be neater to display less Pages in the menu and to enable the Pages menu items to work like admin menu items.
When you hover over one of the Page menus a drop down Page list appears for selection.
Maybe a bridge to far?

So you'll have the normal top-level menu options like Admin, Album options, etc, and then an additional top-level menu called "Pages" (or something else?) and then that menu is auto-populated with every "Page"? Would that work?

 
fotoron

Joined: 2010-04-25
Posts: 32
Posted: Mon, 2011-06-20 05:56
undagiga wrote:
Regular GreyDragon already has this option in "Admin | Appearance | Theme Options".

I know, but what if I prefer to have a sidebar on my photopage and *not* on my static pages?

--

  • My Gallery
  • 3.0.2 (Coollanta) - Grey Dragon Theme 3.0.8 (carbon custom)
 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Mon, 2011-06-20 12:22
Quote:
So you'll have the normal top-level menu options like Admin, Album options, etc, and then an additional top-level menu called "Pages" (or something else?) and then that menu is auto-populated with every "Page"? Would that work?

That's getting there but I was thinking of being able to create more than one menu item, something like the following.
The headings in upper case would be menu items and the lower case items would be pages.

EVENTS
Meetings
Outings

TAKING PHOTOS
Outing brief
Project brief
Licence & legal

UPLOADING PHOTOS
Preparing
Uploading

YEARBOOK
Yearbook 2011
Yearbook 2012

CONTACTS & LINKS
Contacts
Links
Disclaimers

Does this clarify things a bit?
Many thanks.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Wed, 2011-06-22 14:51
zjohn13 wrote:
This looks great to me as well as I want to use a number of static pages on the menu.
Very minor point, the edit box is a tad on the small side, it's a bit like keyhole surgery when working on a large page :-)

Fixed!

fotoron wrote:
An option to hide the sidebar would be nice (like the about module). It gives users full-width blank 'Pages' to work with.

Done!

zjohn13 wrote:
Quote:
So you'll have the normal top-level menu options like Admin, Album options, etc, and then an additional top-level menu called "Pages" (or something else?) and then that menu is auto-populated with every "Page"? Would that work?

That's getting there but I was thinking of being able to create more than one menu item, something like the following.

Okay, I'll have to think about this. This sounds like it might be something that would be better as a separate module rather then a feature of pages.

 
fotoron

Joined: 2010-04-25
Posts: 32
Posted: Wed, 2011-06-22 12:31
Quote:
fotoron wrote:
An option to hide the sidebar would be nice (like the about module). It gives users full-width blank 'Pages' to work with.

Done!

Thanks, two minor things:

1) Your description for the option is "Display sidebar on Pages?" but the setting works the other way around. The description should be "Hide sidebar on Pages?".

2) CSS for hiding the sidebar in GreyDragon is different:

<style type="text/css">
  #g-column-right {
    display: none;
  }
  .g-page-block-content {
    width: 99%; /* Or a value of your liking */
  }
</style>

www.ronvanrossum.com | Gallery 3.0.2 (Coollanta) | Grey Dragon Theme 3.0.8 (carbon custom)

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2011-07-21 17:31
fotoron wrote:
1) Your description for the option is "Display sidebar on Pages?" but the setting works the other way around. The description should be "Hide sidebar on Pages?".

Fixed!

fotoron wrote:
2) CSS for hiding the sidebar in GreyDragon is different:

Fixed!

 
rvon

Joined: 2011-06-13
Posts: 6
Posted: Wed, 2011-06-22 17:36

Is there any way to add PHP or Javascript to a particular "page", like code_block module?

 
inposure
inposure's picture

Joined: 2010-04-23
Posts: 304
Posted: Tue, 2012-03-27 11:18

[delete]

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2011-06-22 20:53

Did you run the upgrader?

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
inposure
inposure's picture

Joined: 2010-04-23
Posts: 304
Posted: Tue, 2012-03-27 11:17

[delete]

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2011-06-23 02:20

I got the same error and running the upgrader fixed it for me.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2011-06-23 03:51

The "display_menu" property in your error message does not exist in version 1, but does exist in version 2, the upgrader is responsible for adding this property. If an older version of the module was installed, you will need to run the upgrader, even if you de-activate/re-active the module between versions.

 
inposure
inposure's picture

Joined: 2010-04-23
Posts: 304
Posted: Tue, 2012-03-27 11:17

[delete]

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Thu, 2011-06-23 05:40

Just did a clean install of Gallery 3.0.2 + Pages 2 -- everything works fine for me. Are you using a different version of Gallery? Is it possible the pages module didn't upload properly?

 
inposure
inposure's picture

Joined: 2010-04-23
Posts: 304
Posted: Tue, 2012-03-27 11:16

[delete]

 
inposure
inposure's picture

Joined: 2010-04-23
Posts: 304
Posted: Tue, 2012-03-27 11:16

[delete]

 
fotoron

Joined: 2010-04-25
Posts: 32
Posted: Thu, 2011-06-23 07:06
rWatcher wrote:
Fixed!

Confirmed, many thanks!


www.ronvanrossum.com | Gallery 3.0.2 (Coollanta) | Grey Dragon Theme 3.0.8 (carbon custom)

 
zjohn13

Joined: 2010-12-01
Posts: 94
Posted: Fri, 2011-06-24 09:22
Quote:
zjohn13 wrote:

Quote:

So you'll have the normal top-level menu options like Admin, Album options, etc, and then an additional top-level menu called "Pages" (or something else?) and then that menu is auto-populated with every "Page"? Would that work?

That's getting there but I was thinking of being able to create more than one menu item, something like the following.

Quote:
Okay, I'll have to think about this. This sounds like it might be something that would be better as a separate module rather then a feature of pages.

Fair enough, I guess that what I'm looking for is a full blown menu manager, maybe something for G3 ver 3.1 :-)

 
Adam Dimech
Adam Dimech's picture

Joined: 2009-01-19
Posts: 7
Posted: Fri, 2011-07-01 15:34

Is there a way to easily change (or customise) the url? www.mysite.com.au/pages/show/my-page-name is ugly.

I don't understand why "pages/show" needs to be included at all, really...

 
Jay123
Jay123's picture

Joined: 2011-07-01
Posts: 8
Posted: Sat, 2011-07-02 15:28

Hey friends,

I installed the pagesModul and I really like it. But three thinks are disturbing me:

One)
Is there a posibility to sort the menu entries?

By now it looks like this.

[img]http://www.smiley-channel.de/fragen.jpg[/img]

And I want to change the order in Home, Gallery, Generator, contact.

Second)

Is there a way to set a start page? I want the Home Page is opening by standart.

Third)
How to rename the Start page into Gallery?

Big thanks and greetings from Germany.
-----------------------------------------------------------------------------------------
EDIT:

It was quite easy to find a solution for my first wish.

[img]http://www.smiley-channel.de/fix.jpg[/img]

I just modified the site_menu function in the pages_event.php to:

Quote:
static function site_menu($menu, $theme) {
$menu_pages = ORM::factory("static_page")
->where("display_menu", "=", true)
->order_by("id", "DESC")
->find_all();
if (count($menu_pages) > 0) {

foreach ($menu_pages as $one_page) {

if ($one_page->id < 10) {
$menu->add_before("home", Menu::factory("link")
->id("pages-" . $one_page->id)
->label($one_page->title)
->url(url::site("pages/show/" . $one_page->name)));
}
else{
$menu->add_after("home", Menu::factory("link")
->id("pages-" . $one_page->id)
->label($one_page->title)
->url(url::site("pages/show/" . $one_page->name)));
}
}
}
}

and sorted in the gallery_static_pages table my entries to:

[img]http://www.smiley-channel.de/db.jpg[/img]

As you can see all id´s under 10 will be set before the start button. All id´s over 9 move behind the "Start-Button". Not the smoothest solution but for me the fastest.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2011-07-02 15:10
Quote:
How to rename the Start page into Gallery?

Just rename the root album.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Jay123
Jay123's picture

Joined: 2011-07-01
Posts: 8
Posted: Sun, 2011-07-03 08:52

Hi Dave,
stupid question but how can I rename the root album? I found no option for that.

And I hope you have the same thing in mind when I said that I want to rename the Home Button.

I was able to change the "Home" message per searchfunction in the database for my german language.
But when I switch to English it´s still shows home and nothing worked till now.

Greetings JAY

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sun, 2011-07-03 14:51

@ rename root album: edit the root album. There you will see that the root album is "gallery" you can change that there. from the root album choose Album options-> edit album.
@rename home link: http://codex.gallery2.org/Gallery3:Modules:menu_links
I would not edit the DB to change text. You can change the text through the translation user interface.
Start a new thread for more info in these regards as this thread is for the Pages module.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2011-07-04 18:23
Adam Dimech wrote:
Is there a way to easily change (or customise) the url? www.mysite.com.au/pages/show/my-page-name is ugly.

I don't understand why "pages/show" needs to be included at all, really...

No. If you don't want "pages/show" in the URL then you'd have to make a separate module for each page. If you wish to go that route, try looking at the about module as a starting point:
http://codex.gallery2.org/Gallery3:Modules:about

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Mon, 2011-07-04 21:45
zjohn13 wrote:
Quote:
zjohn13 wrote:

Quote:

So you'll have the normal top-level menu options like Admin, Album options, etc, and then an additional top-level menu called "Pages" (or something else?) and then that menu is auto-populated with every "Page"? Would that work?

That's getting there but I was thinking of being able to create more than one menu item, something like the following.

Quote:
Okay, I'll have to think about this. This sounds like it might be something that would be better as a separate module rather then a feature of pages.

Fair enough, I guess that what I'm looking for is a full blown menu manager, maybe something for G3 ver 3.1 :-)

Try this module:
http://gallery.menalto.com/node/102814

 
fotoron

Joined: 2010-04-25
Posts: 32
Posted: Tue, 2011-07-05 08:10

I like it! How do I move the menu entry to the 'Pages Settings' from 'Settings' to 'Content', just like where this new Custom Menus module is located? I think it makes more sense there.


www.ronvanrossum.com | Gallery 3.0.2 (Coollanta) | Grey Dragon Theme 3.0.8 (carbon custom)

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2011-07-05 15:03

Edit /modules/pages/helpers/pages_event.php, on line 23 change "settings_menu" to "content_menu".

 
fotoron

Joined: 2010-04-25
Posts: 32
Posted: Tue, 2011-07-05 17:43

Yes, that did the trick. You've made my day!


www.ronvanrossum.com | Gallery 3.0.2 (Coollanta) | Grey Dragon Theme 3.0.8 (carbon custom)

 
kukrapok
kukrapok's picture

Joined: 2011-07-16
Posts: 32
Posted: Thu, 2011-07-21 10:27

Hi there!

is there a way to make the contents of a page translatable? Same question for the menu entry added for each page. The text to translate doesn't appear in the strings list (when in translation mode). This question applies as well to items added using the custom_menus module, I guess.

 
rWatcher
rWatcher's picture

Joined: 2005-09-06
Posts: 722
Posted: Tue, 2012-07-03 19:05
kukrapok wrote:
Hi there!

is there a way to make the contents of a page translatable? Same question for the menu entry added for each page. The text to translate doesn't appear in the strings list (when in translation mode). This question applies as well to items added using the custom_menus module, I guess.

This _should_ make everything translatable in pages (pages menu links, sidebar, the actual page). Keep in mind, I'm not sure if there's a limit on how much text you can have gallery translate at once, so there may or may not be an issue with larger pages with lots and lots of text.

I've also moved the Pages Settings link over to the content menu, as per this request.

fotoron wrote:
How do I move the menu entry to the 'Pages Settings' from 'Settings' to 'Content', just like where this new Custom Menus module is located? I think it makes more sense there.

 
kukrapok
kukrapok's picture

Joined: 2011-07-16
Posts: 32
Posted: Fri, 2011-07-22 10:29

I see a new "Gallery :: ", "HTML code" (and few other ones) untranslated strings, but nothing else (I installed the new files pages-module over the old ones), turned on translation mode when seeing my custom page and "all strings".
I tried also from the edit mode, I could complete some fr translation (uploaded) but my text still doesn't show up.