Features other than pictures using G2?

mfoster711

Joined: 2005-03-06
Posts: 118
Posted: Mon, 2005-04-04 03:14

I curious if there are plans to add some basic webpage features to G2 such as a links page?

I use G2 for my personal website and I want to add a few extra features like a links page. I used PHP-Nuke with gallery 1 and it worked fine but using PHP-Nuke seemed like overkill for the few basic items I want.

Ideas?

[url]www.markafoster.com[/url]

 
Kirill
Kirill's picture

Joined: 2004-12-22
Posts: 53
Posted: Mon, 2005-04-04 04:59

If you just want a static page with the G2 layout, You'll need to make a very simple module. I can show you one that would do that, if you're interested.

 
mfoster711

Joined: 2005-03-06
Posts: 118
Posted: Tue, 2005-04-05 03:32

Sure, I would be interested. What do I need to do?

 
mfoster711

Joined: 2005-03-06
Posts: 118
Posted: Sun, 2005-04-10 04:33

Anybody else?

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Tue, 2005-04-12 19:34

Kirill appears to be AWOL. :-(

I've made a simple demo module that puts a "My Stuff" box in the sidebar and a "My Page" link in it, which takes you to a very simple view that just renders the template of your choice. I'm attaching it here.

Note that in the template I'm using {g->text} blocks which will localize your strings. If you don't care about localization, just put your text in verbatim and don't worry about that. I'm also doing $module->translate in HtmlPageView for the same reason.

This should be enough to get you started. Have fun!

 
Kirill
Kirill's picture

Joined: 2004-12-22
Posts: 53
Posted: Wed, 2005-04-13 01:04

Oops. I honestly lost track of this topic, sorry! I'll see if I can whip something up tonight. Hang tight.

 
Kirill
Kirill's picture

Joined: 2004-12-22
Posts: 53
Posted: Wed, 2005-04-13 03:45

Alright, Bharat's module should have started you off on the right foot, but in case you need a step by step walkthrough of the necessary steps take a look here. I've whipped up a couple of lessons that will teach you how to code a simple G2 module to do what you're trying to do. It's honestly not the greatest piece of literature, but it's a good rough draft for me. I'll edit it properly later :).

Do note however, that the tutorial does not yet cover plugging in to the sidebar navigation as Bharat's module does.

 
mfoster711

Joined: 2005-03-06
Posts: 118
Posted: Thu, 2005-04-14 02:46

I am working through it, I will let you know how it goes

 
Kirill
Kirill's picture

Joined: 2004-12-22
Posts: 53
Posted: Thu, 2005-04-14 02:48

Great! Let me know if there's anything you're stuck on.

 
mfoster711

Joined: 2005-03-06
Posts: 118
Posted: Thu, 2005-04-14 03:24

Kirill, I worked through yours and all went well. I did have an error when I tried to activate the tutorial1 but I think it was just a typo because once I copied your whole example page everything worked fine.

Here is the page http://www.markafoster.com/g2/main.php?g2_view=tutorial2:MyPage

Now I just need to decide what I want to do with this.

I liked you explanation of the basic files. That helped put things in perspective and I am sure it will help me out.

I am going to look through bharat's example now.

 
Kirill
Kirill's picture

Joined: 2004-12-22
Posts: 53
Posted: Thu, 2005-04-14 03:39

Awesome. I didn't actually test out the code, so I'm glad to see it's all working.

You now have a basic grasp of the G2 module and templating system. If you want to add more pages, you can just duplicate MyPage.inc and MyPage.tpl and replace the instances of "MyPage" with the pagename.

Bharat's module is very similar to the one the tutorial teaches you to make, but the module.inc also sets a 'loadSystemContent' callback. Try adding that to your setCallbacks line and pasting the last block of Bharat's module.inc (the @see GalleryModule::loadSystemContent portion) to your module.inc in tutorial2 (make any necessary path changes). Then, copy the HtmlSystemContent.tpl to your tutorial2/templates dir.

This will essentially allow you to add a little block to the sidebar with links to your custom pages (or whatever else you'd want there).

Happy coding.

 
mfoster711

Joined: 2005-03-06
Posts: 118
Posted: Fri, 2005-04-15 03:54

I modified the HtmlSystemContent.tpl to have more links. That is half of what I was looking for. I plan to install webcalendar on my website and wanted to have a link to it.

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Sat, 2005-04-16 07:12

Bharat, thank you for html module.
The only problem I experienced with it while using G2 embedded into phpnuke, is that nuke's Sidebar Block shows "There isn't content right now for this block." as soon as i click on 'My page' (which shows up just fine).
The same problem could be seen when i try to use search located in sidevar: all results are correct, but sidebar shows "there isn't content.."
It could happen that problem comes form actual nukes' G2 module....

bharat wrote:
Kirill appears to be AWOL. :-(

I've made a simple demo module that puts a "My Stuff" box in the sidebar and a "My Page" link in it, which takes you to a very simple view that just renders the template of your choice. I'm attaching it here.

Note that in the template I'm using {g->text} blocks which will localize your strings. If you don't care about localization, just put your text in verbatim and don't worry about that. I'm also doing $module->translate in HtmlPageView for the same reason.

This should be enough to get you started. Have fun!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-04-16 13:00

c4actbe, @embedded G2: is this "There isn't content right now for this block." message dependent on whether you have this html module installed or not? if it's dependent, it's likely a issue with the html module.
But i'm quite sure it has nothing to do with this module.
You get this message only, when you look non-G2 pages / Modules in phpnuke, right?

 
c4actbe
c4actbe's picture

Joined: 2004-09-01
Posts: 83
Posted: Sat, 2005-04-16 17:35

nope. it hapens EVERY TIME when i use sidebar for accessing something else, other than images/albums, for example:
1. I type something in the search field located in sidebar and hit 'search'...
2. when i click 'advanced search', page refreshes...
3. I click on "Members List", and user list opens...
in all case the correct page opens, BUT all content in nuke's block-G2sidebar.php dissapears and shows up inside gallery2 module...

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2005-04-16 18:33

yeah, that's no bug, that's a known issue. all "(user) admin pages" can't show the sidebar outside the G2 html region.

 
dj-3plet

Joined: 2005-03-12
Posts: 70
Posted: Sun, 2005-04-17 00:40

i've been playing around with this for a bit and i've got it working. i set up a faq on my site. the only problem is, the sidebar doesn't work. the link to my faq appears in the sidebar, but when the faq page loads, there is no sidebar. i followed the instructions in the tutorial, which says to use this:

list ($ret, $navigationView) = GalleryView::loadView('core:Navigation');
        if ($ret->isError()) {
            return array($ret->wrap(__FILE__, __LINE__), null);
        }

        list ($ret, $ignored) = $navigationView->loadTemplate($template, $form);
        if ($ret->isError()) {
            return array($ret->wrap(__FILE__, __LINE__), null);
        } 

am i missing something else? i'm a total novice with php.

by the way, this is exactly what i was looking for. i have another thread about an email module. i'm sure if i can get over this little issue, i'll be able to close out that other thread too. thanks in advance!

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2005-04-17 00:46

dj-3plet, i see that you have a question in your faq concerning speed. and you write that you host it on your own server. that's ideal. the only thing you have to do now is to install a php accelerator (phpa, turk mmcache or eaccelerator).
and you could also keep your database tables in RAM, and tweak the system in other ways.

as to your question. i guess the sidebar is not included because bharat thought more people would like it more like that.
could someone who uses this html module take a look at it? it should be fairly ease to include the sidebar, maybe in the template.

 
dj-3plet

Joined: 2005-03-12
Posts: 70
Posted: Sun, 2005-04-17 01:27
valiant wrote:
dj-3plet, i see that you have a question in your faq concerning speed. and you write that you host it on your own server. that's ideal. the only thing you have to do now is to install a php accelerator (phpa, turk mmcache or eaccelerator).
and you could also keep your database tables in RAM, and tweak the system in other ways.

thanks. i'll look into that. do you know of a tutorial?

 
Kirill
Kirill's picture

Joined: 2004-12-22
Posts: 53
Posted: Sun, 2005-04-17 04:21

dj-3plet, after the nav. view is loaded it also must be included in the template to display it. Take a look at this lesson, particularly the MyPage.tpl file (note how there's a line including the template).

Good luck!

Edit: you might need to wait a whiiile for that page to load. Apache's being hit pretty hard, gotta figure out the problem ('Server up 89 days, 1:44, running 47.69 load.'). Eek!

 
dj-3plet

Joined: 2005-03-12
Posts: 70
Posted: Sun, 2005-04-17 12:22
Kirill wrote:
after the nav. view is loaded it also must be included in the template to display it.

got it - thanks! all works fine now.

 
dj-3plet

Joined: 2005-03-12
Posts: 70
Posted: Sun, 2005-04-17 12:24
valiant wrote:
the only thing you have to do now is to install a php accelerator (phpa, turk mmcache or eaccelerator).

last night i installed eaccelerator - what a difference! its literally 5 times faster now. thanks for the suggestion!

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2005-04-18 03:08

That's because my dummy module doesn't include any sidebar support. I'm redoing how that part of the system works, with Beta 3 as a target. If you can hold on for a while, then this should be resolved.

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Mon, 2005-04-18 03:08
Kirill wrote:
dj-3plet, after the nav. view is loaded it also must be included in the template to display it. Take a look at this lesson, particularly the MyPage.tpl file (note how there's a line including the template).

Good luck!

Kirill -- This is excellent! Can I add a link to it in the developer documents? Thanks!

 
Kirill
Kirill's picture

Joined: 2004-12-22
Posts: 53
Posted: Mon, 2005-04-18 04:08
bharat wrote:
Kirill wrote:
dj-3plet, after the nav. view is loaded it also must be included in the template to display it. Take a look at this lesson, particularly the MyPage.tpl file (note how there's a line including the template).

Good luck!

Kirill -- This is excellent! Can I add a link to it in the developer documents? Thanks!

Thanks, feel free to link to it from the site - it's not going anywhere.

I'm planning on pursuing the writing of a lesson series idea. I know from experience how frustrating it can be to try to understand the G2 module system if you don't have significant PHP experience. However, I think the main challenge that has to be overcome is understanding how the files interact with each other and creating those first two or three modules. Once the developer 'gets' the system, they will need little assistance to teach themselves further functionality.

Any further comments welcome, of course.

Edit: it seems like this thread has strayed from it's original topic somewhat. Would it be possible to rename it to better reflect the nature of the discussion, so users searching/browsing the forum would be more likely to come across relevant information? Something like 'Custom pages for G2'.

 
stukintx

Joined: 2005-04-15
Posts: 16
Posted: Mon, 2005-08-22 23:14

Does this still work for G2 Insightful? I loaded Bharat's module but I'm not seeing the "My Stuff" box in the sidebar. I had to change the CoreApi and ModuleApi to the current version and after that I was able to successfully install the module. What am I missing?

 
stukintx

Joined: 2005-04-15
Posts: 16
Posted: Fri, 2005-08-26 13:21
stukintx wrote:
Does this still work for G2 Insightful? I loaded Bharat's module but I'm not seeing the "My Stuff" box in the sidebar. I had to change the CoreApi and ModuleApi to the current version and after that I was able to successfully install the module. What am I missing?

Anybody?

 
oddhNP

Joined: 2005-01-18
Posts: 37
Posted: Tue, 2005-08-30 18:31

sorry for being so stupid....

I have to hang on to stukintx's question, I try both of these examples, try to install it, and that works, but for Kirills example, I get an error, and for Bharat's, the MyStuff on the sidebar does not show up.
Could the method here be to old???

 
stukintx

Joined: 2005-04-15
Posts: 16
Posted: Fri, 2005-09-02 15:59

oddhNP, I don't think an answer will be forthcoming soon. Don't know why some questions are answered and some not but it appears that's the way it is here :(

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-09-02 16:35

that's just because we try to annoy you :)

actually, this is something i'd expect that Kirill or bharat would maintain because they were involved in creating this mini module. so that's the reason why perhaps noone answers. i should / could have let bharat know that there are questions in this topic.

however, i've just tested this module and after changing the required core api to 6,0 and the module api to 2,0 in the module.inc file, it installed correctly.
i can also browse to main.php?g2_view=html:HtmlPage and i see the page.

what else do you want?
another name? change the module / HtmlPage file and class names.

actually there's one thing in the module that is totally out of date.
function loadSystemContent(). this was a concept in G2 prior to beta 4. now it should be replaced by something else, e.g. just a link or a block.

 
stukintx

Joined: 2005-04-15
Posts: 16
Posted: Fri, 2005-09-02 19:07

valiant, Thanks for your reply. As I stated in my initial post the module installed fine for me too after making the necessary changes but acording to the the post from bharat and I quote

"I've made a simple demo module that puts a "My Stuff" box in the sidebar and a "My Page" link in it, which takes you to a very simple view that just renders the template of your choice. I'm attaching it here. "

I do not see the My Stuff box on the sidebar. oddhNP wrote he had the same problem...no My Stuff box on the sidebar. I did delete the template and database cache but still no My Stuff box on the sidebar.

This is the spot I'm stuck at. Hopefully you can help us out.

Thanks again

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Fri, 2005-09-02 20:12

the "my stuff box in the sidebar" is exactly this obsolete loadSystemContent thing that needs to be replaced by a G2 block. so someone would need to work a little on the module.
bharat and the rest of the dev team are very busy at the moment with getting g 2.0 out of the door, so don't expect something from us at the moment.

 
stukintx

Joined: 2005-04-15
Posts: 16
Posted: Sun, 2005-09-04 13:02

valiant...thanks for the info. At least I now know it's not something I was doing wrong

 
Kevin7654

Joined: 2005-09-08
Posts: 14
Posted: Wed, 2005-09-14 05:05

Where can I find Bharat's static html module?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-09-14 06:22

it's the attachement to the first post of this topic.
but please read the most recent messages. it's out of date and doesn't work as it should right now.

 
Kevin7654

Joined: 2005-09-08
Posts: 14
Posted: Wed, 2005-09-14 20:52

thanks for the response. Now I'm trying to get kirill's tutorial to work. I made the tutorial2 module as instructed and now I get this error when I browse to g2_view=tutorial2:MyPage. Any ideas why this is happening?

thanks,
Kevin

Error
An error has occurred.

Back to the Gallery

Error Detail -
Error (ERROR_BAD_PARAMETER) : /homepages/41/d88620562/htdocs/wsc88620570/gallery2/modules/core/classes/../../../modules/core/Navigation.inc
in modules/core/classes/GalleryView.class at line 158 (gallerystatus::error)
in modules/tutorial2/MyPage.inc at line 47 (galleryview::loadview)
in modules/core/classes/GalleryTheme.class at line 688 (mypageview::loadtemplate)
in modules/core/classes/GalleryView.class at line 285 (matrixtheme::loadtemplate)
in main.php at line 287 (mypageview::doloadtemplate)
in main.php at line 87
in main.php at line 80
System Information
Gallery version 2.0
PHP version 4.3.10 cgi
Webserver Apache/1.3.33 (Unix)
Database mysql 4.0.25-standard-log
Toolkits NetPBM, Gd
Operating system Linux infong 2.4 #1 SMP Mon Aug 9 10:21:08 CEST 2004 i686 unknown
Browser Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Wed, 2005-09-14 23:19

maybe the tutorial is out of date or you did something else wrong, because modules/core/Navigation.inc just doesn't exist.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sun, 2005-10-02 16:17

Is the StaticHTML module now dead, in mothballs or about to be re-awakened?

 
johnbrawn

Joined: 2005-10-05
Posts: 4
Posted: Wed, 2005-10-05 23:59

This is something that would be very useful to me also. I'm running a released version of G2 with CoreApi 6.8 and ModuleApi 2.0.

Is there anyone who can tweak the HTML module to operate correctly with the current version?

Thanks in advance,

J.

 
golgi

Joined: 2005-10-03
Posts: 17
Posted: Thu, 2005-10-06 19:04

To make this work module work with your version of G2, all you have to do is go into the html module folder and edit the module.inc file.

Just edit these lines:

$this->setRequiredCoreApi(array(6, 8));
$this->setRequiredModuleApi(array(2, 0));

It should work fine then.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Thu, 2005-10-06 21:57

Well, the StaticHTML module's modification 'works' if by that you mean 'allows itself to be installed'. Something like the rpm Linux command line switch --force (it works but it overides all the built in checks).

I wonder if this has happened here... looking within the StaticHTML module it would seem that I should expect to see linker instances of 'My Stuff' and/or 'My Page' but I haven't found any such yet.

Is there anything else to be done, or have I overcustomised everything here to the point that I can't see the effects of an activated StaticHTML module?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Tue, 2005-10-11 12:47

Does anyone have the StaticHTML module properly running?

 
mcnnr3

Joined: 2005-10-19
Posts: 5
Posted: Sun, 2005-10-23 04:03

im a complete newbie, but would this work as a workaround?:

use the current out of date staticHTML module(with $this->setRequiredCoreApi(array(6, 8));
$this->setRequiredModuleApi(array(2, 0)) inserted), and simply add a link to /main.php?g2_view=staticHTML:MyPage in the sidebar.tpl file of your theme

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sun, 2005-10-23 10:40

My theme doesn't use the sidebar.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-10-24 05:32

i think you can still apply the concept of that nice suggestion..

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Tue, 2007-06-19 08:49

mcnnr3----thank you for taking the time to examine the issue and also for articulating what might be a helpful workaround. However I was unable to get your suggestion to work;~/

mindless----staticHTML module has seemingly been abandoned by its author (Gallery's inventor no less). The Wiki assists by pointing to this very thread. The actual staticHTML module has to be hot-wired in two seminal areas for it to even be recognised by G2 (ie as being valid for installation). It's provenance for survival across G2 updates/upgrades doesn't look promising. I don't have a sidebar and so put a simple link in the description of the top level album. The latter of which is what I am using instead of a relatively static 'front page'. Accessing that link leads to an error...

Error Detail -
Error (ERROR_BAD_PARAMETER) : 
/home/e-smith/files/ibays/ic/html/modules/core/classes/helpers/../../../../modules/staticHTML/module.inc

    * in modules/core/classes/helpers/GalleryPluginHelper_simple.class at line 105 (gallerystatus::error)
    * in modules/core/classes/helpers/GalleryPluginHelper_simple.class at line 99 (gallerypluginhelper_simple::loadplugin)
    * in modules/core/classes/GalleryCoreApi.class at line 187 (gallerypluginhelper_simple::loadplugin)
    * in modules/core/classes/GalleryView.class at line 129 (gallerycoreapi::loadplugin)
    * in main.php at line 262 (galleryview::loadview)
    * in main.php at line 87
    * in main.php at line 80

I am aiming to code my site so that G2 replaces the aging osCommerce code that I tweaked at great effort a year or two ago. I'm not a programmer, I just see pictures. These (staticHTML) links were to be aimed at spyders' indexation. Short-lived modules supporting those static links won't be helpful establishing a newly coded site. Is there something I can do to ameliorate this situation... other than articulating that 'My theme doesn't use the sidebar'?
----best wishes, Robert

[postedit: make URL generic]

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-10-24 14:16

yeah, we need to update this module at some point...

btw: it's "spider" and not "spyder" :) (just pointing this out since you're writing spyder in all your posts :) )

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2005-10-24 14:53

Entirely deliberate with the emphasis on spy.
Much like as in M$ with the emphasis on dollars.

 
mcnnr3

Joined: 2005-10-19
Posts: 5
Posted: Mon, 2005-10-24 16:41

icpix, i was in fact able to get my idea to work. your error message is exactly what i see when i mistype the name of the module in the url. i believe the syntax for the link should be "/main.php?g2_view=[modulename]:[templatepage]". if you downloaded the html.tar.gz module in the beginning of this thread, then modulename would be html and template page would be HtmlPage (cap sensitive). check that your naming of everything is correct and let me know if that works.

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2005-10-24 20:13

mcnnr3---- Have just come in and experimented. You are 100% correct in your assessment and its remedy - well done;~) However I now have a newspaper deadline to meet but I will return to the thread.
----best wishes, Robert

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Fri, 2005-10-28 08:44

I now have an info (static) page up;~) To scale this up for more separate pages I assume I need to add more modules albeit with differing names, or is there a more ergonomic programming type solution within the existing module?
----best wishes, Robert