Closed (fixed)
Project:
Node Gallery
Version:
6.x-3.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
11 Jan 2010 at 21:02 UTC
Updated:
12 Nov 2010 at 21:50 UTC
Jump to comment: Most recent file
Comments
Comment #1
dbeall commentedI see that node_gallery_access has a view included..
I don't know much, but node gallery should have had at least 2 views with default install 'if views installed' many months ago. A 'list page', A 'random/latest image block' that does NOT include the password.gif.
Now if node_gallery gets a view, then the view from node_gallery_access will not be needed because the only thing that is added is the access filter.
I am like many people, views is a first install(all my sites have it), I am guessing most Drupal sites use views.. I don't like to talk for 'all' people, because that is what the politicians do and they are wrong 99% of the time.
But then, all my sites use ckeditor too....
There is one in the handbook Display Gallery List Page in Table Format for Import
Comment #2
justintime commentedMan, you're quick - I just committed that view addition last night ;-)
That view is me just kinda learning how to do default views at module installation time. The good news here, is that if views isn't installed, there's no special code needed to prevent that view from attempting to be installed. Even better, if you install/enable views later, it will pull in the public_galleries view at that point in time.
Given this, I think maybe the best approach is to always install the static, non-view page at /galleries no matter what. Then, if available, we can install the view at a different location.
Does anyone know what will happen if you create a views page with a URL of /galleries? Which one wins? If views wins, then I think we have our answer. If the static page wins, we need to come up with a new URL for the views-based one to be installed at.
Comment #3
designwork commentedHi justintime,
I would do it with a simple if module_exists..... So if views is installed just install the default views, else go to static page. As I know Views will win in case that the URl /galleries is double .
Cheers
Dirk
PS I did this before.
Comment #4
dbeall commentedI didn't test the install action for the node_gallery_access view, I just robbed the views code from cvs and posted the view page on my demo.. http://www.davebeall.com/public_galleries
I did notice the path events/[nid] lingering in the code. It may be of some use.?
OFF TOPIC:
Since node_gallery_access is outside node_gallery, maybe the password.png will not show in the random/latest image block...hmmmm
Comment #5
designwork commentedHi dbeall, kimonty, justintime
Here comes the first try for a node_gallery.views.default.inc it will take over the galleries path. The view is from dbeall, we can now play a bit with this and later add it to the node_gallery module.
But I would prefer some changes in the node_gallery structure. We have now an folder called includes where we store the views handlers and our views.inc are in the module folder. I would like to rename the includes folder to views and store all views related stuff there, than it becomes more logical in my opinnion. We just add the new path to the function node_gallery_views_api(). in the node_gallery.module
So if every buddy agrees I would make the changes and we see how we apply it to CVS. I will try to get all views problems solved today.
Cheers Dirk
PS. just rename the file to node_gallery.views.default.inc and copy it into the module folder.
Comment #6
justintime commentedWhile I agree with you, there's a problem here. There is no guaranteed way within the module to remove old files. You can check to see if they are there, and *sometimes* you may be able to remove them, but not usually on Unix as the owner of the files is different from the user running Apache.
Now, the user is supposed to delete the old module before installing the new version... but I have to admit, I never did until I found out I was doing it wrong after using Drupal for some matter of months.
So, while it may make sense to the dev to rename folders, we need to keep in mind that our little move could cause user issues down the road. It shouldn't cause any real problems, as updating hook_views_api() will cause it to stop looking in the old folder, but it may confuse someone wanting to peek into our views implementation.
I'm not saying I'm against the move (I'm actually for it), just playing devil's advocate. Let's see what kmonty thinks before we do that though.
Comment #7
designwork commentedHi justintime,
I know that this will maybe cause some problems but it will make thinks easier in the future. For module updates there is a handbook page http://drupal.org/node/250790. A user always should remove all old files first before installing an upgraded module! At least we should try to get this into our new 6.x-3.x branch.
I have a problem to create patches at the moment. I can not find the Team->Create Patch (only apply patch) in my Eclipse instalation. So I have some stuff here to send to you but I`m not able at the moment to do it. I need to install Eclipse again.
I try to send some patches asap.
Cheers
Dirk
Comment #8
dbeall commentedwell, I may be different, but I have always (since day one) deleted module files before uploading new or updated modules. I was new to the whole upgrade process when starting with Drupal 6 (June 2008). At first it was to force the date to change on the server (so I could tell at a glance when the module was uploaded), but quickly found out that many updated modules had different files and I just don't trust overwrites anyway. I don't know about the people using drush or cvs upload/upgrade, not in that crowd yet as I still have trouble with controlling cvs.(noob) It seems to be neat and fast.
The 'node_gallery/views' directory makes sense. Some modules like user relationships has user_relationships/user_relationship_views/ ,,but that is verbose.
The view might need some adjustment, depends on what folks would want. I think that one came from the issue que someplace...
Comment #9
justintime commentedUsually when that happens to me, it's because I didn't checkout the files from CVS when I created the project (ie, I just pointed it at the files on the filesystem). If you have Team->Share Project available, then that is for sure your problem.
Comment #10
designwork commentedHi justintime,
based on my suggestions on http://drupal.org/node/693066 I made a new views_default.inc. It brings now two default views.
1. The default gallery view on the URL galleries. Here you may list any node_gallery you want.
2. The default my galleries view on the URL galleries/my. This one shows only Galleries of the current logged in user.
So lets see what else we can provide.
Comment #11
designwork commentedforgot the file :)
Comment #12
hassansr commentedI have been able to get NG to work reasonably with views but have not able to get it work with imagecache in the way desired. I have a client that wants to have an image gallery like this one:
http://www.villadelarte.com/gallery1.htm
where you have a scaled (50w) list of galleries on the left side and the artist gallery on the right scaled but larger (100w). Using NG would be perfrect for this, however I can't get views to work properly to give me the views that I want to use.
I have been able to get views to give me a imagecover list, with names of the image covers but not the galleries. What do i need to add to get the imagecover with gallery name, scaled to say 45w. I know how to have gallery thumbs be scaled on an different view at 55w.
$view = new view; $view->name = 'nodegallery_coverimg'; $view->description = 'A block with all gallery cover images'; $view->tag = ''; $view->view_php = ''; $view->base_table = 'node'; $view->is_cacheable = FALSE; $view->api_version = 2; $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */ $handler = $view->new_display('default', 'Defaults', 'default'); $handler->override_option('fields', array( 'title' => array( 'label' => '', 'alter' => array( 'alter_text' => 1, 'text' => '[title]', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 1, 'exclude' => 0, 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'id' => 'title', 'table' => 'node', 'field' => 'title', 'relationship' => 'none', 'override' => array( 'button' => 'Override', ), ), 'gid' => array( 'label' => '', 'alter' => array( 'alter_text' => 0, 'text' => '', 'make_link' => 0, 'path' => '', 'link_class' => '', 'alt' => '', 'prefix' => '', 'suffix' => '', 'help' => '', 'trim' => 0, 'max_length' => '', 'word_boundary' => 1, 'ellipsis' => 1, 'strip_tags' => 0, 'html' => 0, ), 'link_to_node' => 1, 'node_gallery_setting' => 'node_gallery_gallery', 'exclude' => 0, 'empty' => '', 'hide_empty' => 0, 'empty_zero' => 0, 'id' => 'gid', 'table' => 'node_galleries_gallery', 'field' => 'gid', 'relationship' => 'none', 'override' => array( 'button' => 'Overrite', ), ), )); $handler->override_option('access', array( 'type' => 'none', )); $handler->override_option('cache', array( 'type' => 'time', 'results_lifespan' => '3600', 'output_lifespan' => '3600', )); $handler->override_option('items_per_page', 0); $handler->override_option('distinct', 1); $handler->override_option('style_options', array( 'grouping' => '', )); $handler->override_option('row_options', array( 'inline' => array(), 'separator' => '', 'hide_empty' => 0, )); $handler = $view->new_display('block', 'Block', 'block_1'); $handler->override_option('block_description', ''); $handler->override_option('block_caching', -1);
Comment #13
dbeall commentedhere is the public-gallery view that is included with the node_gallery access module, with some settings changed
It is a list, with cover images and gallery name
EDIT, scale images with image cache
Comment #14
hassansr commentedthanks for your efforts,
the views gets me most of the way there, it pulls in the link to the gallery, the gallery name and the place holder for the image scaled sown as desired, however it doesnot display the cover image. any ideas?
please see the content section of this page (middle) on the side bars, you'll see my original work
http://vpfc.net/art/node/112
Comment #15
hassansr commentedi cant seem to get the view to pull the correct imagecache
for instance sites/default/files/imagecache/awe /testgallery/may107_008.jpg
Comment #16
designwork commentedHi hassansr,
wich node_gallery version your are using? 6.x-2.x dev? If yes you have something miss configured in your imagecache I belive. Your images url looks like:
http://vpfc.net/art/sites/default/files/imagecache//testgallery/me_and_r...
You have an empty trailing slash between imagecache and testgallery. Wich gallery path settings do you have?
Dirk
Comment #17
hassansr commentedHi
i am using the latest version
Node Gallery 6.x-2.0-alpha12
Node Gallery Access 6.x-2.0-beta2
http://vpfc.net/art/sites/default/files/imagecache/awe/imagecache_sample...
dont know how that // got into the view. also when i tried to review the field settings, the images reverted to gallery thumbs, not cover
Comment #18
dbeall commentedI am using the dev releases from Jan 17th and 18th on that test site install.
You might find that the dev versions may work better for you since views has been fixed up some. And a few other things..
Comment #19
hassansr commentedtried, even on clean install, no luck.
can you think of another appraoch?
Comment #20
dbeall commented@hassansr, your drupal.org contact form in your account is not turned on... It is best to have your contact form enabled.
This thread is actually not the right place for this stuff since the thread is about a different subject.
Attached is the file to use, put it in the node_gallery/includes folder
rename it to- node_gallery_handler_field_gid.inc -replace the one that is there(keep the old one for back up).
Comment #21
hassansr commentedHi Dave
Thanks for the quick response and help on this one. The results turned out really well.
BTW I have tried to turn on the contact form but it doesnt seem to want to work.
I'll copy and paste this portion of the tread plus my changes to the issues for NG section
Thx
Hassan
Comment #22
dbeall commented@hassansr, Glad it's working, looks good. You can rename the menu text in 'page' view section, in the 'page settings' and the 'path' can be changed as well. The 'Page Title' can be renamed or removed in the 'Title' of the view. That views handler is better than the old one.. I believe it is going into the module.(I have a hard time keeping track of some of this stuff).. BTW,Node_Gallery3 will be very cool! something to look forward to.
Comment #23
hassansr commentedone last question. do you have a way to disable downloads from the gallery? My client wants that function on her site.
Yes, I have explained to her that images do cache and that their are work arounds if a person really wants to download a file, but I just need to give her what she wants
Comment #24
dbeall commentedthis is not Drupal code, but you could use it,, see this issue
http://drupal.org/node/697568
Comment #25
justintime commentedNG3 requires views and uses them for these pages.