Displaying assigned tags
rWatcher
Joined: 2005-09-06
Posts: 722 |
Posted: Thu, 2009-07-16 01:33 | |||
If anyone's interested I've uploaded a module to my github called "displaytags" which should display whatever tags the album/photo you're looking at has been tagged with. It's a fairly simple module that I've created so I can see which photo's I've already tagged. If you need more functionally then that you're probably going to have to wait for the gallery3 people to implement it themselves It can be downloaded from: ---
|
||||
Posts: 7994
I've pulled this into the gallery3-contrib repository. thanks! We're going to be writing functionality like this for the official release, but it's good to see there's something in the interim.
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git | help! vote!
Posts: 27300
rWatcher ...the module machine!
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 74
Another nice addition.
This module gave me the idea to remove the tag cloud, because I don't particularly care for them. When I disabled the tags module, your module stopped working -- were you intending to depend on the tags module in some way?
Undaunted, I figured out how to keep the tags module running, but still hide the tag cloud. It was a simple task to comment out a few lines of code. To the core team -- do you think you would be interested in a modified version of the tags module that makes this an option configured by a check box? If so, I am willing to give ti a try and send you the updated code. Let me know.
Posts: 27300
Please create a fork on git hub:
http://codex.gallery2.org/Gallery:Using_Git
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 722
I wrote my module to run in addition to the tags module. I figured that, as you need the tags module to actually assign tags, it would be a pretty safe assumption that it was installed . That said, you could probably modify it easily enough to work without tags installed, if you so choose (although it sounds like you've already solved your problem by simply modifying tags).
Posts: 128
This is something I wanted to do myself, so thanks for saving me the trouble.
Copied the module etc and activated it. Just what needs to be placed in the view to
make this appear?
Martyn T. Griffin
Posts: 27300
Add to the css:
that should the tag cloud.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 11
Thank you very much! Displaytags-new did in fact give me most of what I was looking for!
Only thing now, is that I want it to be above the random image, rather than below it...I want it to follow the Tags module. I'll do some reading, to see if there's a way to configure that though.
Thanks again!
Posts: 27300
There has been a new change to the modules blocks:
http://github.com/gallery/gallery3/commit/60d35b89929d9029c794f72d6a9c38b676e282f6
it adds a UI to sort/rearranges item in the sidebar.
3rd party modules like this one will have to be udated to take advantage of this new feature.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 10
So, I take it that this module no longer works with the current experimental version?
Posts: 722
I've created an updated version of DisplayTags:
- Merged in ckieffer's CSS changes for Gallery 3 Git
- Updated for the new sidebar code in Gallery 3 Git
- Tested everything against current git (as of commit b6c1ba7ea6416630b2a44b3df8400a2d48460b0a)
It is attached here, and has been uploaded to my github account.
Posts: 722
The attached version of DisplayTags includes the changes bharat recently made on github. Otherwise it's the same as the previous zip file. I've tested this against the current version of Gallery 3 on github (as of commit 38f2784fbbb0661dc57627d2878cb640bbffe271), and everything worked fine for me.
Posts: 241
Does your module now require the latest experimental code to work properly? I happen to be on the base beta 3 at the moment. Suppose I should upgrade to the latest experimental code anyway.
Thanks,
Mark H.
Posts: 241
I'm using version that came out of gallery-gallery3-58620c5.zip from git. I installed the displaytags.zip that you just attached. I added a tag to a photo and it does show the tag I added "Snow". However, if I click on the link it makes for the tag: (test gallery)/tags/Snow it generates a 404 error. The normal link that it seems to use in the tag cloud (test gallery)/tags/show/1 which works. My current .htaccess rewrite is the default:
Is there something I need to adjust in it?
My test gallery is at gallery3.markheadrick.com
Thanks,
Mark H.
Posts: 722
It should work properly now.
Posts: 7994
I've pulled this into the gallery3-contrib repo. Thanks, rWatcher!
---
Problems? Check gallery3/var/logs
bugs/feature req's | upgrade to the latest code | use git
Posts: 241
Well, the change does work, thanks. Personally, I would actually like for URLs like (gallery)/tag/(tag word) to work as that would match the URLs that WordPress uses for tags. I guess wherever in the code that it deciphers the URLs it could be modified to decipher the URL and look up the word in the tags table using the name field to then get the numerical ID.
Thanks,
Mark H.
Using Gallery 2.2.6 - gallery.markheadrick.com
Posts: 7
I installed the version attached above and it does not seem to be working. The tags are simply not being displayed on any of the tagged images.
Is there something I need to do other than installing the module and activating it? I just feel like I must be missing something here.
Posts: 722
What version of Gallery 3 are you using? The module is only compatible with the newer git builds, not the older beta 3 version.
Posts: 7
I'm using the beta3 version. I tried to install the git build (copying /var to the new directory to ensure it was a fresh install, correct? note: the beta3 is installed to the root directory, the git build is installed to /gal3 -- both still exist.) only to come to this page:
Hey wait, you're an admin! We can tell you stuff.
Kohana_Exception [ Framework Error ]: The requested views, page.html, could not be found
1.
SYSPATH/core/Kohana.php[ 812 ]
807 if ($found === NULL) 808 { 809 if ($required === TRUE) 810 { 811 // If the file is required, throw an exception 812 throw new Kohana_Exception('The requested :resource:, :file:, could not be found', array(':resource:' => __($directory), ':file:' =>$filename)); 813 } 814 else 815 { 816 // Nothing was found, return FALSE 817 $found = FALSE;
2.
SYSPATH/libraries/View.php[ 83 ] » Kohana_Core::find_file( arguments )
3.
SYSPATH/libraries/View.php[ 49 ] » View_Core->set_filename( arguments )
4.
MODPATH/gallery/libraries/MY_View.php[ 56 ] » View_Core->__construct( arguments )
5.
MODPATH/gallery/libraries/Theme_View.php[ 32 ] » View->__construct( arguments )
6.
MODPATH/gallery/controllers/albums.php[ 73 ] » Theme_View_Core->__construct( arguments )
7.
MODPATH/gallery/controllers/albums.php[ 22 ] » Albums_Controller->show( arguments )
8.
{PHP internal call} » Albums_Controller->index()
9.
SYSPATH/core/Kohana.php[ 330 ] » ReflectionMethod->invokeArgs( arguments )
10.
SYSPATH/core/Event.php[ 208 ] » Kohana_Core::instance( arguments )
11.
APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments )
12.
DOCROOT/index.php[ 90 ] » require( arguments )
Posts: 722
Sounds like you're missing a file. I believe this is the /gal3/themes/THEMENAME/views/page.html.php that it's complaining about.
Posts: 7
Interesting.
I got too frustrated and went back to 2!
Posts: 337
Is there a way to merge the ability of adding new tags with this module? I want my users to be able to add tags to the items as well as see the assigned ones, but I don't want to depend on two sidebar blocks (PopularTags + DisplayTags). I don't care about the popular tags, I just want to see the assigned tags of the items as well as have the ability to add a one.
Posts: 722
You can assign tags using the Photo Options -> Edit Photo screen instead of the tags sidebar.
You could probably "hack" a tag prompt into the displaytag module, although I don't know how reliable that would be. Try inserting some code like this into the bottom of the modules\displaytags\views\displaytags_block.html.php:
Posts: 337
Many thanks. That did it!
The only problem was there, is that the block doesn't appear if there is no tags assigned to the item, but I could override this by removing that if statement from: "displaytags/helpers/displaytags_block.php":
As an improvement, is it easy to add an Ajax code to display the tag(s) after adding them without reload the page?
Thanks again
Posts: 722
Well, you could do something like this to add the new tag name to the end, but it won't be clickable (that would be a lot more complicated):
Posts: 337
Many many thanks !
Posts: 573
My Dang! is sorted out - thanks
all the best
HB - http://www.image.agentura.dk
Posts: 424
the display tags module does not seem to want to display in my sidebar!
http://gallery.andrewshemo.com/index.php/
Posts: 722
Looks fine to me.
Posts: 424
doesn't work in google chrome.
edit- it works..it wasn't showing up because I don't have album tags.
Posts: 27300
Looks good to me. I am surprised that it looks so similar.
[img]http://gallery.menalto.com/files/side-by-side-tags.png[/img]
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 3
any idea how to get this module right under the photo, instead of the sidebar?
been playing around for a while now but i don't get it
Posts: 3
Never mind, found the solution here: how to show tags for an album
Posts: 6
This is a great module and works fine for my set up.
I would like to tailor it though to only show in Admin mode to help me set up my gallery by seeing which photos i have already tagged, but not allow guests to see this module.
Being a php novice, what would i need to change to just getit to display in Admin mode only?
Any clues greatly appreciated.
Cheers
WW