Features other than pictures using G2?
mfoster711
Joined: 2005-03-06
Posts: 118 |
![]() |
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
![]()
Joined: 2004-12-22
Posts: 53 |
![]() |
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 |
![]() |
Sure, I would be interested. What do I need to do? |
|
mfoster711
Joined: 2005-03-06
Posts: 118 |
![]() |
Anybody else? |
|
bharat
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
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
![]()
Joined: 2004-12-22
Posts: 53 |
![]() |
Oops. I honestly lost track of this topic, sorry! I'll see if I can whip something up tonight. Hang tight. |
|
Kirill
![]()
Joined: 2004-12-22
Posts: 53 |
![]() |
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 |
![]() |
I am working through it, I will let you know how it goes |
|
Kirill
![]()
Joined: 2004-12-22
Posts: 53 |
![]() |
Great! Let me know if there's anything you're stuck on. |
|
mfoster711
Joined: 2005-03-06
Posts: 118 |
![]() |
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
![]()
Joined: 2004-12-22
Posts: 53 |
![]() |
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 |
![]() |
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
![]()
Joined: 2004-09-01
Posts: 83 |
![]() |
Bharat, thank you for html module. bharat wrote:
Kirill appears to be AWOL. |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
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. |
|
c4actbe
![]()
Joined: 2004-09-01
Posts: 83 |
![]() |
nope. it hapens EVERY TIME when i use sidebar for accessing something else, other than images/albums, for example: |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
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 |
![]() |
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 |
![]() |
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). as to your question. i guess the sidebar is not included because bharat thought more people would like it more like that. |
|
dj-3plet
Joined: 2005-03-12
Posts: 70 |
![]() |
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). thanks. i'll look into that. do you know of a tutorial? |
|
Kirill
![]()
Joined: 2004-12-22
Posts: 53 |
![]() |
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 |
![]() |
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 |
![]() |
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
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
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
![]()
Joined: 2002-05-21
Posts: 7994 |
![]() |
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). Kirill -- This is excellent! Can I add a link to it in the developer documents? Thanks! |
|
Kirill
![]()
Joined: 2004-12-22
Posts: 53 |
![]() |
bharat wrote:
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 |
![]() |
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 |
![]() |
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 |
![]() |
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. |
|
stukintx
Joined: 2005-04-15
Posts: 16 |
![]() |
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 |
![]() |
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. what else do you want? actually there's one thing in the module that is totally out of date. |
|
stukintx
Joined: 2005-04-15
Posts: 16 |
![]() |
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 |
![]() |
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. |
|
stukintx
Joined: 2005-04-15
Posts: 16 |
![]() |
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 |
![]() |
Where can I find Bharat's static html module? |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
it's the attachement to the first post of this topic. |
|
Kevin7654
Joined: 2005-09-08
Posts: 14 |
![]() |
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, Error Back to the Gallery Error Detail - |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
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 |
![]() |
Is the StaticHTML module now dead, in mothballs or about to be re-awakened? |
|
johnbrawn
Joined: 2005-10-05
Posts: 4 |
![]() |
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 |
![]() |
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)); It should work fine then. |
|
robert070612
Joined: 2003-08-05
Posts: 565 |
![]() |
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 |
![]() |
Does anyone have the StaticHTML module properly running? |
|
mcnnr3
Joined: 2005-10-19
Posts: 5 |
![]() |
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)); |
|
robert070612
Joined: 2003-08-05
Posts: 565 |
![]() |
My theme doesn't use the sidebar. |
|
mindless
![]()
Joined: 2004-01-04
Posts: 8601 |
![]() |
i think you can still apply the concept of that nice suggestion.. |
|
robert070612
Joined: 2003-08-05
Posts: 565 |
![]() |
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'? [postedit: make URL generic] |
|
valiant
Joined: 2003-01-04
Posts: 32509 |
![]() |
yeah, we need to update this module at some point... btw: it's "spider" and not "spyder" |
|
robert070612
Joined: 2003-08-05
Posts: 565 |
![]() |
Entirely deliberate with the emphasis on spy. |
|
mcnnr3
Joined: 2005-10-19
Posts: 5 |
![]() |
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 |
![]() |
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. |
|
robert070612
Joined: 2003-08-05
Posts: 565 |
![]() |
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? |
|