(SOLVED) Create Title field to "Add Items (From Web Browser)" page
Alexandra70
Joined: 2004-12-08
Posts: 143 |
Posted: Fri, 2008-02-01 02:29 |
Hello!! I need help creating a code (inside ItemAddFromBrowser.tpl I suppose??) that would add the Title field (above the Caption field) to the "Add Items (From Web Browser)" page. I found the post below, but it didn't work. Thank you, |
|
Posts: 143
Anyone?
Posts: 143
Well, no one responded, and this Topic had already gone to the second page here...
I figured a solution to this yesterday... gosh.. can't believe it worked.... was on it for maybe about 5 hours.
I will post the solution here just in case someone needs this, because I could not find a solution at all through Search. I guess it doesn't exist.
Don't laugh at how silly this looks or how complicated I made it... but it WORKED!! Since I can't write PHP, all I could do was change things around or copy PHP from other files and only changed what I knew how to change.
First of all, I needed this so bad because in the "Add from Browser" page, there was only a File upload field and a Caption field.
My Gallery will not display the "Summary" anymore for either Albums nor Pics as my Users would write really LONG "Summaries". I want the Photo Thumbs page (inside Album) to look neat. Just the photo Title, and then the Description would only be seen on the actual photo page.
So, back to the "Add from Browser" page...
I wanted my Users to set a Title and a Description to each photo when they upload them.
The only option on the bottom of that page was:
Set item titles from:
Filename (didn't want that one)
Blank (didn't want that either)
Caption (That was ok).
Then, my brain neurons finally connected and I realized that I had posted this stupid Topic, without explaining what I needed to accomplish. No wonder no one responded.
The MAIN problem was the "Assign caption to: Summary Description"
I already had a way to set the "Title" for the uploaded pic...
Just pick "Set item titles from: Caption" and the UNCHECK BOTH "Assign caption to: Summary Description"
Voilá... that would take care of JUST the Title without setting Summary & Description with the same thing.
I knew that, after all these years using Gallery.. But if I used that feature to set the Title, then how would I set the Description upon upload too??
I think that it's unnecessary work when people need to go to "Edit Captions" later to either set the Title OR the Description because they couldn't do both at the same time from the "Add from Browser" page.
So if I already used the "Set item titles from: Caption" to set the Title... if I did the other way around and "Set item titles from: Caption" to set the Description by leaving "Assign caption to: Description" CHECKED, then I wouldn't have the Title anymore!!!!! Duh!!!!
It was either one or the other.
So there was no way to set BOTH at the same time.
That's why I came here asking how to create a Title field.
I could have instead, asked how to create a Description field too...
Either solution would have helped me.
And I needed to get this done ASAP.. and waited and waited and no one replied.
So here's how I fixed it. (sorry for the long introduction... just wanted to explain what my real problem was, as I noticed that the Topic question seemed quite stupid)
-----------------------------
First, I had to set the default of "Set item titles from:" from "base filename" to "Caption". (found a post here explaining that)
Edit modules/core/templates/local/ItemAddFromBrowser.tpl
Change
To
Then I needed to make sure that "Assign caption to: Summary Description" were BOTH UNCHECKED by default.
So I removed (or you can comment it out) the following:
(still in ItemAddFromBrowser.tpl)
Then I had to HIDE that whole bottom section of the "Add from Browser" page.. so that my Users would NOT make any changes there.
So I found this post:
http://gallery.menalto.com/node/59217
So basically, to HIDE that section... you do this:
Still editing ItemAddFromBrowser.tpl, you change the gbBlock:
To
But WAIT.. Now you need to edit your Theme's theme.css file.
Add this:
Voilá... the section "Set item titles from:" of the "Add from Browser" page is gone!!
If you also want that "Gallery can create thumbnails at upload time" to be gone too, the just move the closing (/div) to underneath {/foreach}, as in:
---------------
Ok... So that's done. I had my TITLE FIELD set. Now I needed to create a Description field and had NO CLUE on how to do that since I cannot write PHP.
I searched this Forum for DAYS.. and all I could find was a post that showed how to add a Keywords field to that same page.
So I tried to understand the Greek-To-Me-PHP and see if I could change the Keywords code given on that post to make the Description field instead.
And I got it!!!
Ta-Daaaa.. I now had both my Title and Description Field. Yippeeee...
I still did some more customizing like:
Kept it simple by removing BBCode markup.
Added a yellow line to separate each "Title", "Description", "File" blocks of 3, when people clicked on "More Upload Boxes..."
Moved the File field below Title and Description.
Changed the name-text of the "old" Caption field to "Title".
Added a character limit to the Title field.
And changed the Title field from <textarea to <input type="text".
To
And here's how it looks... MADE BY ME!!! (so damn proud) (<---- SNOB!!!)
[img]http://www.makeachildsmile.org/images/other/additems.jpg[/img]
Nice!!! Mission accomplished!!
Posts: 41
But... you're a Genius !!!! Thank U very much for your GREAT work !!!
Versione di Gallery = 2.2.4 core 1.2.0.6
Versione PHP = 4.4.7 apache2handler
Webserver = Apache/2.0.52 (CentOS)
Posts: 8
For some reason my Description doesnt works .. still save as Blank.
I had it all installed/replaced correctly, except this following..
mine is ver. 2.4 Full. Please give some more hint or have you try it on full version yet?
Thanks
Posts: 143
Sorry... I didn't understand what the problem is...
What do you mean "still save as Blank"
Please explain more what is wrong and what are you trying to accomplish.
I don't think it matters if you have the full version or not... The full one comes with a bunch of modules. The most important files (core) and modules will be the same no matter if you have the full version or not.
Posts: 8
I mean file has been added but when I edit file . Description box is empty.
I am paste it correctly? <h4>
somewhere around Lines 48-50
and Result both Title and Description fields got the same information ..
Before:
>File
>Title: Test Title
>Desc: Test Desc
AFTER
>File Added
>Title: Test Title
>Desc: blank
btw, if you dont mind .. may I see your [ ItemAddFromBrowser.tpl ] working codes?
Posts: 143
Here is my file.
Keep in mind, that I made A LOT of changes to it.
Even some small modifications (cosmetics) AFTER I posted this topic. But what you want still remains the same.
Posts: 12
Alexandra70, thank you so much for sharing such an extensive customization for the add items page, I have used it and it has been sooooo helpful, however I am having the same problem as hicsong up there did, where the Description comes out blank after upload. Was there ever a solution found for this issue? Any ideas?
Posts: 143
Hi Ryno80,
Well, I just tested my Gallery, uploaded an image using my tweaked Add Items page, and the Description came out just fine after the Upload.
So I really don't know what's going on there.
I am attaching my file here again... Keep in mind, that I have Gallery version = 2.2.4 core 1.2.0.6
So if you have a newer version, maybe that could be the problem. Or maybe do everything all over again... step-by-step as I did above, as you could have missed something.
Alex
Posts: 26
Oh this will come in handy after I solve a few other problems I am going to try this. Thanks for posting your changes for us.
Posts: 12
Alexandra70, thanks for the reply and attachment, I re-did everything step by step and triple checked the code and still no luck. Are you sure that you didn't edit ItemAddFfromBrowser.inc as well in this process??
Posts: 143
Ryno, first of all... are you using the same G2 Version as me???
Second... don't know if THEME matters... but I am using Classic.
I reviewed all my notes (I always write down all the changes I made to Gallery so I know what and where was changed) just in case all my files someday disappear and I need to do all the customizing from scratch again........ and I did not find any notes that I modified the INC file. But just in case, here it is attached.
Then going through my notes, I found one other customization that I will paste here... BUT.... I don't think that it has ANYTHING to do with your Description not setting.
But here it is just in case because it's the only other thing I could think of, that has to do with adding items.
What is does is the following:
When my users upload a file named "ourtriptothebeachwithuncletom.jpg" or "DC19374785639.jpg" I always hated that when you were viewing a picture, the NAME of the file would show on the URL and on the breadcrumb... Some files had stupid names, some were too long, etc... So I wanted it all to be nice, clean and uniform.
So any image added, is automatically renamed to "aaa.jpg", "aaa_001.jpg" and so on....
Edit modules/core/classes/helpers/GalleryItemHelper_medium.class
Again, I think this has nothing to do with the Desc. problem... but... oh well.
I think that it either has to be if we are on different G2 Versions... or.... maybe different THEMES.
The only way you can rules these in or out... would be to install a TEST Gallery if you can, and make sure you get the same version that I use, and then activate the Classic Theme. If my modifications work, then that's what it was. Just a thought... though a lot more work to do.
Keep asking if you think of anything else... I know how frustrating it is when you can't get something to work or worse, when it partially works!
Alex
Posts: 81
I think I figured it out. By PURE LUCK.
Anyway I was having the same problem with descriptions not showing up. I edited the ItemAddFromBrowser.inc
Find
and make it look like this
then find
and make it
And viola! Descriptions are added with the mod mentioned above.
Posts: 143
Good job blw91126!!!! I am glad it worked out!!!
Funny how my version works without those modifications... weird!!
At least people will have 2 options then, if one does not work.
Thanks for posting!!
Alex
Posts: 2
Hi guys.
This is a great find and went without a hitch. Including the description on the image once I applied the second fix.
One question though, How do I get the description to show on the gallery page that shows the thumbnails?
I have attached an image to show you.
Thanks in advance for any help.
Posts: 2
Well you wouldn't believe it. I thought I would 'poke' around the album.tpl file to see if I could see anything and guess what! I solved it.
All I did was replace all mention of the word summary with the word Description or description (where the case was different).
Hope it helps.