Topic Closed
Charles S
448 Posts
13.7K Downloads
2 Themes
8 Plugins

I was attempting to display images in non-gallery pages with colorbox. 

I don't know if there is a way to turn colorbox's javascript & CSS on for all pages, without of course putting it into the theme.

I did find the two lines needed make it work if someone wants to put it in their theme or in a page:

<script type="text/javascript" src=".././/include/js/admin.js?v=1.7a1"></script>
<link type="text/css" media="screen" rel="stylesheet" href=".././/include/thirdparty/colorbox136/example1/colorbox.css?v=1.7a1" />
 
They need to be placed after the call for the header = <?php gpOutput::GetHead(); ?> if put in the theme, or you can place the two lines right in the page you want the image to be displayed by colorbox.
*note in the css "example1" can be any of the 6 examples in the admen for colorbox.
 
I'm curious if colorbos JS/CSS  can be called all the time so we can simply use the name="gallery" rel="gallery_gallery" in the anchor to display an image in colorbox when desired?
Edited: 10 years ago#493

cyberman
85 Posts
1.5K Downloads
1 Plugins

Not checked but it seams a similar thing could be possible ... see the last entry here

docs.gpeasy.com/index.php/Main/Javascript#WBheaderAdding_to_Addon.ini

10 years ago#498

Charles S
448 Posts
13.7K Downloads
2 Themes
8 Plugins

yeah, but I don't know what to do with that lol

you meant the following code right?

 

common::AddColorBox();

I'm sure there is some way to turn colorbox on for images easier. I guess that's what I'm asking. But I don't know php thus that code doesn't really say a lot to me :D

And I don't think that will do anything without the javascript also being turned on. . . but again. I don't have much of a clue when it comes to php--just follow tutorial etc ;)

Any ideas?

Edited: 10 years ago#499

cyberman
85 Posts
1.5K Downloads
1 Plugins

Yep, meant that.

Have make a look ... colorbox is NOT available every time.

But you can insert this

        <?php common::AddColorBox();?>

as the first line in your template and the head area get the links like in your first posting in this thread ;).

Edited: 10 years ago#503

Charles S
448 Posts
13.7K Downloads
2 Themes
8 Plugins

OH. . . I see. It has to be the first php called in the template. I tried it but had it after the gethead. . .duh! Never said I was an expert lol

So, for anyone else looking at this.

Simply put the above addcolorbox code before you call the header with <?php gpOutput::GetHead(); ?>

Then add: name="gallery" rel="gallery_gallery"

after the href="" link for the image.

tada your image will open in colorbox even when it's not in a gallery page.

Thanks a lot for the help cybermax, much appreciated. Guess we'll have to add some of these little tips to the documentation wiki for gpEasy.

10 years ago#504

cs
80 Posts

Hi,

you can also find a guide on that here in the documentation forum (with only 3 posts)

Just for info....

10 years ago#507

Charles S
448 Posts
13.7K Downloads
2 Themes
8 Plugins

CS,

yep, that would have saved me some time. I think some of these things, like cybermax suggested in another post, need to be put into the documentation wiki. . . maybe a little more clearly for those of use that don't know much :)  

Even the php code for colorbox is buried in the "javascript" section. Maybe a Colorbox heading would be more obvious even if redundant?

10 years ago#508

Topic Closed

 

News

elFinder 2.1.50 in Upcoming Release
12/28/2019

A new release for Typesetter is in the works with a lot of improvements including the ... Read More

Typesetter 5.1
8/12/2017

Typesetter 5.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

More News

HH-Support

Company located in T├│rshavn, Faroe Islands. * Webpage Design * Consultant & Provider of a wide range of programs for visually impaired and dyslextics.

Find out more about our Provider Spotlight

Log In

  Register