• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug Customization How To Have Same Description in Multiple Galleries

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #130 (Hot or Cold), Memol..

The next Dgrin Challenge DSS #131 (Music) is open for entries through June 24th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Page 1  of  2
1 2
Old Jan-20-2006, 08:34 AM
#1
Andy is offline Andy OP
panasonikon
Andy's Avatar
How To Have Same Description in Multiple Galleries
Anyone have any thoughts or ideas on this?


Quote:
Originally Posted by anonymous emailer
I am setting up a dozen galleries that will all have the same description. But if/when I need to make a change, I’ll have to do it to each of the 12 galleries separately. Not fun…

Is there a method which will allow me to store that text somewhere and “share” it within the description field? I was thinking about JavaScript, but thought to check in first as I know security is an issue…
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-20-2006, 08:59 AM
#2
bwg is offline bwg
SmugMug Sorcerer
bwg's Avatar
Quote:
Originally Posted by Andy
Anyone have any thoughts or ideas on this?
an easy (and cool) solution.

in the control panel -> customize -> javascript block put the following:

Code:
[FONT=Courier New]var dA = new Array(1);
dA[0] = "hi, i'm a javascript description!";[/FONT]
in the album description, put the following:

Code:
[FONT=Courier New]<html><script type="text/javascript">document.write(dA[0]);</script></html>[/FONT]
you'll have to put the above in all 12 galleries the first time, but when the description changes, you just update the description once in javascript.

by creating an array, we can just keep adding descriptions and use them in other galleries as well.

example: if i were to add another description, my javascript would look like:
Code:
[FONT=Courier New]var dA = new Array(2);
dA[0] = "hi, i'm a javascript description!";
[/FONT][FONT=Courier New] dA[1] = "hi, i'm a second javascript description!";[/FONT]
and so on.
__________________
Pedal faster
Old Jan-20-2006, 09:45 AM
#3
Andy is offline Andy OP
panasonikon
Andy's Avatar
Thanks so much, bigwebguy! Andy tested and approved. It works a treat. Simple, elegant.

WTG
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-20-2006, 09:50 AM
#4
bwg is offline bwg
SmugMug Sorcerer
bwg's Avatar
Quote:
Originally Posted by Andy
Andy tested and approved.
we need a stamp or seal or something.
__________________
Pedal faster
Old Jan-20-2006, 10:07 AM
#5
Andy is offline Andy OP
panasonikon
Andy's Avatar
Quote:
Originally Posted by bigwebguy
we need a stamp or seal or something.
Sounds like something dragon300zx should come up with, eh?
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-20-2006, 05:19 PM
#6
dragon300zx is offline dragon300zx
What God Complex?
dragon300zx's Avatar
Quote:
Originally Posted by Andy
Sounds like something dragon300zx should come up with, eh?
On It. So many Ideas for this though.
__________________
Everyone Has A Photographic Memory. Some Just Do Not Have Film.
www.zxstudios.com
http://creativedragonstudios.smugmug.com
Old Jan-22-2006, 02:08 PM
#7
dlobel is offline dlobel
IMYRLESS
Doesn't appear to work in "list" mode...
Thanks for the solution. It works when viewing the particular gallery, but it appears not to display properly when viewing a list of galleries.

It doesn't appear to Execute the documet.write(). It only displays the code as text.

Thoughts?

-Dave-


Quote:
Originally Posted by bigwebguy
an easy (and cool) solution.

in the control panel -> customize -> javascript block put the following:

Code:
[FONT=Courier New]var dA = new Array(1);
dA[0] = "hi, i'm a javascript description!";[/FONT]
in the album description, put the following:

Code:
[FONT=Courier New]<html><script type="text/javascript">document.write(dA[0]);</script></html>[/FONT]
you'll have to put the above in all 12 galleries the first time, but when the description changes, you just update the description once in javascript.

by creating an array, we can just keep adding descriptions and use them in other galleries as well.

example: if i were to add another description, my javascript would look like:
Code:
[FONT=Courier New]var dA = new Array(2);
dA[0] = "hi, i'm a javascript description!";
[/FONT][FONT=Courier New]dA[1] = "hi, i'm a second javascript description!";[/FONT]
and so on.
Old Jan-22-2006, 02:11 PM
#8
Andy is offline Andy OP
panasonikon
Andy's Avatar
Quote:
Originally Posted by dlobel
Thanks for the solution. It works when viewing the particular gallery, but it appears not to display properly when viewing a list of galleries.

It doesn't appear to Execute the documet.write(). It only displays the code as text.

Thoughts?

-Dave-
Dave, I'll look at your site right now. Don't customize, please.
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-22-2006, 02:12 PM
#9
Andy is offline Andy OP
panasonikon
Andy's Avatar
Dave,

Here's your Javascript:

Code:
var galleryDesc = new Array(1);
galleryDesc[0] = "<Font Class=galleryHeader> You are viewing Images from the Woodbury Nursery School 2005 Class Portraits. This gallery contains both individual and group images. If you are interested in ordering prints, please download and print the <a href=http://www.davidlobel.com/Forms/WJC_Nursery_Fall_2005_Order_Form.pdf Target=_new> Order Form</a>. If you do no have Adobe Acrobat, you will need to install it from the link at the top of this page, before you can view the order form. <Font Color=White>Please Note: </Font></b>The images you are viewing have an embedded watermark. Purchased images will not contain our watermark and will be printed using full resolution, color correction and proper cropping. If you have any questions, please <a href=JavaScript:emailMSG()>click here</a></Font>.";

var galleryDesc = new Array(1);
galleryDesc[0] = "<Font Class=galleryHeader> You are viewing Images from the Woodbury Nursery School 2005 Class Portraits. This gallery contains both individual and group images. If you are interested in ordering prints, please download and print the <a href=http://www.davidlobel.com/Forms/WJC_Nursery_Fall_2005_Order_Form.pdf Target=_new> Order Form</a>. If you do no have Adobe Acrobat, you will need to install it from the link at the top of this page, before you can view the order form. <Font Color=White>Please Note: </Font></b>The images you are viewing have an embedded watermark. Purchased images will not contain our watermark and will be printed using full resolution, color correction and proper cropping. If you have any questions, please <a href=JavaScript:emailMSG()>click here</a></Font>.";

src="http://www.photodex.com/presenter.js"
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-22-2006, 02:17 PM
#10
Andy is offline Andy OP
panasonikon
Andy's Avatar
I added quotes around the href, and changed target=new to target= "_blank" which is the way I know it..


var galleryDesc = new Array(1);
galleryDesc[0] = "<Font Class=galleryHeader> You are viewing Images from the Woodbury Nursery School 2005 Class Portraits. This gallery contains both individual and group images. If you are interested in ordering prints, please download and print the <a href="http://www.davidlobel.com/Forms/WJC_Nursery_Fall_2005_Order_Form.pdf" target= "_blank">Order Form</a>. If you do not have Adobe Acrobat, you will need to install it from the link at the top of this page, before you can view the order form. <Font Color=White>Please Note: </Font></b>The images you are viewing have an embedded watermark. Purchased images will not contain our watermark and will be printed using full resolution, color correction and proper cropping. If you have any questions, please <a href=JavaScript:emailMSG()>click here</a></Font>.";

And I have no clue what the below is:

src="http://www.photodex.com/presenter.js"
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-22-2006, 02:18 PM
#11
Andy is offline Andy OP
panasonikon
Andy's Avatar
I know the code works, becuase I tested it and have it going here:

http://andydemo.smugmug.com/

I just changed the gallery names for you on my demo site...
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-22-2006, 02:23 PM
#12
Andy is offline Andy OP
panasonikon
Andy's Avatar
Hi Dave,

I don't think that you can put the hrefs in in this manner - the code given by bigwebguy works just great for text. See my andydemo.smugmug.com site for that..

I tried it and couldn't get it to work with links.

The issue with the html (hrefs) is that the descriptions MUST have <html> at the beginning and </html> at the end. Maybe there's a JS trick that can handle this, we'll need to wait for the JS experts
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-22-2006, 02:28 PM
#13
Andy is offline Andy OP
panasonikon
Andy's Avatar
Also, there's a typo in your desc:

If you do no have
If you do not have...
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-22-2006, 02:32 PM
#14
Andy is offline Andy OP
panasonikon
Andy's Avatar
OK, bigwebguy:

I had tested it just fine in Titles - now in Descriptions, I can get a very long description to show up just fine - but on the home page, the description shows as:

Can you help?
Attached Images
 
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-22-2006, 05:13 PM
#15
dlobel is offline dlobel
IMYRLESS
Andy,

I removed all HTML code from the text. Now it's just plan text, severl sentences. So, I don't think it's the HREF.

-Dave-

Quote:
Originally Posted by Andy
Hi Dave,

I don't think that you can put the hrefs in in this manner - the code given by bigwebguy works just great for text. See my andydemo.smugmug.com site for that..

I tried it and couldn't get it to work with links.

The issue with the html (hrefs) is that the descriptions MUST have <html> at the beginning and </html> at the end. Maybe there's a JS trick that can handle this, we'll need to wait for the JS experts
Old Jan-22-2006, 05:28 PM
#16
Andy is offline Andy OP
panasonikon
Andy's Avatar
Quote:
Originally Posted by dlobel
Andy,

I removed all HTML code from the text. Now it's just plan text, severl sentences. So, I don't think it's the HREF.

-Dave-
JT's off today (weekend) but I'll ask him to check and look into why, tomorrow. Check back tomorrow night...

Don't forget that typo!

Oh and I see you got the custom right click working, nice

Now put this in your HEAD TAG area:

<script language="javascript">document.title="|| David Lobel Photography / Visionlink Media ||"</script>

and watch the browser title bar change
__________________
Andy
Moon River Photography • Workshops • Google+ • Facebook • Twitter
Old Jan-23-2006, 01:34 AM
#17
bwg is offline bwg
SmugMug Sorcerer
bwg's Avatar
Quote:
Originally Posted by Andy
JT's off today (weekend) but I'll ask him to check and look into why, tomorrow. Check back tomorrow night...

Don't forget that typo!

Oh and I see you got the custom right click working, nice

Now put this in your HEAD TAG area:

<script language="javascript">document.title="|| David Lobel Photography / Visionlink Media ||"</script>

and watch the browser title bar change
this was my bad. I forgot that descriptions on the category pages and homepage dont support html.

I understand and agree with the reason that JT does this. It's because the description is truncated and he wouldnt be able to close the tags etc.. so he chooses to just not try and display the html at all.

The implementation however is to just remove the tags and let the guts of the tags remain...which i think is maybe not the best. Just removing the entire html block would be the better way to go IMHO, and would solve this problem.

I've tried to hack the html remover to confuse it into showing the tags, but all my tricks havent worked. Looks like he's using a pretty strong expression to get the tags removed. I'll see if i can figure out another way around this....but it will most likely mean not having the descriptions show up in the category pages.

I may have to call in the cavalry:
__________________
Pedal faster
Old Jan-23-2006, 07:24 AM
#18
dlobel is offline dlobel
IMYRLESS
bigwiseguy,

No worries, the code was/is a great idea. But when you say to "remove the tags and let the guts of the tags remain", are you referring to the HTML in my text within the JS or the HTML tags in the DESC field in the gallery?

I removed all HTML tags in the actual text. Thus, the only tags left are:

<html><script type="text/javascript">document.write(galleryDesc[0])</script></html>

I removed the <html></html> from the above line, but that too didn't work.

So, are you reccommending that I go back and just cut and past the entire text in each DESC field?

It appears that you just can't have "any" HTML coding in the DESC field.

Sorry to be confused. Late night :)

-Dave-

Quote:
Originally Posted by bigwebguy
this was my bad. I forgot that descriptions on the category pages and homepage dont support html.

I understand and aree with the reason that JT does this. It's because the description is truncated and he wouldnt be able to close the tags etc.. so he chooses to just not try and display the html at all.

The implementation however is to just remove the tags and let the guts of the tags remain...which i think is maybe not the best. Just removing the entire html block would be the better way to go IMHO, and would solve this problem.

I've tried to hack the html remover to confuse it into showing the tags, but all my tricks havent worked. Looks like he's using a pretty strong expression to get the tags removed. I'll see if i can figure out another way around this....but it will most likely mean not having the descriptions show up in the category pages.

I may have to call in the cavalry:
Old Jan-23-2006, 07:52 AM
#19
bwg is offline bwg
SmugMug Sorcerer
bwg's Avatar
Quote:
Originally Posted by dlobel
bigwiseguy,

No worries, the code was/is a great idea. But when you say to "remove the tags and let the guts of the tags remain", are you referring to the HTML in my text within the JS or the HTML tags in the DESC field in the gallery?

I removed all HTML tags in the actual text. Thus, the only tags left are:

<html><script type="text/javascript">document.write(galleryDesc[0])</script></html>

I removed the <html></html> from the above line, but that too didn't work.

So, are you reccommending that I go back and just cut and past the entire text in each DESC field?

It appears that you just can't have "any" HTML coding in the DESC field.

Sorry to be confused. Late night :)

-Dave-
the implementation that i was talking about was the way the smugmug servers handle the html on the category pages. They remove only the tags instead of the tags and everything in between. If the tags and everything in between were removed, then you would have blank descriptions on the category screen, but the correct dynamic descriptions inside the gallery. In my opinion, this is a better way to go than the current way of just removing the tags.

In short, my original solution doesn't look like it's gonna work as it is now. I'll try and play with it some more and see if i can get something working.
__________________
Pedal faster
Old Jan-23-2006, 07:55 AM
#20
dlobel is offline dlobel
IMYRLESS
Thanks. Much appreciated.

-D-


Quote:
Originally Posted by bigwebguy
the implementation that i was talking about was the way the smugmug servers handle the html on the category pages. They remove only the tags instead of the tags and everything in between. If the tags and everything in between were removed, then you would have blank descriptions on the category screen, but the correct dynamic descriptions inside the gallery. In my opinion, this is a better way to go than the current way of just removing the tags.

In short, my original solution doesn't look like it's gonna work as it is now. I'll try and play with it some more and see if i can get something working.
Page 1  of  2
1 2
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump