Keyword

Any way to disable item image lightbox?

  • canderson
  • canderson's Avatar Topic Author
  • Offline
  • Senior Member
More
13 years 5 months ago #96027 by canderson
Any way to disable item image lightbox? was created by canderson
I'd like to turn off the lightbox option within a K2 item - aka I don't want the embedded K2 image to be clickable. I can't find any parameter or setting to disable this (I want to keep lightbox effects for other things, just not the K2 item images).

Any clues?

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #96028 by Panagiotis
Replied by Panagiotis on topic Any way to disable item image lightbox?
I d like to do the same too ! I mean to disable K2 lightbox when the user clicks for addtion or update ! Any ideas?

Please Log in or Create an account to join the conversation.

  • Concerto Designs Inc.
  • Concerto Designs Inc.'s Avatar
  • Offline
  • Junior Member
More
13 years 5 months ago #96029 by Concerto Designs Inc.
Replied by Concerto Designs Inc. on topic Any way to disable item image lightbox?
1. create a custom K2 template using the recommended mvc method (copy/rename the default template - new template will live in your own template html directory).

2. open item.php and go to line 208 (or thereabouts).

3.Remove the anchor around the image, starting with here:

<a class="modal" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('Click to preview image'); ?>">

Make sure you strip out the closing </a> tag as well (@ line 210.
Note that removing class name "modal" should kill the lightbox, but leaves the anchor, which you porb don't need. 

4. then be sure to select your new template in the category or menu (some K2 menu types allow for K2 template overrides).

Cheers,

Alan

 

 

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #96030 by Panagiotis
Replied by Panagiotis on topic Any way to disable item image lightbox?
Hi Alan, thank you for your useful tips but let me explain please the situation!

I am in the state of editing or adding an item in K2 and the squeezebox with the editing form opens. Since i ve made some small changes in the form by adding an <input type=file> in an Html new form, that has as an action a call to an external php. After the submission this php must return to the editing form control and also a single value.

If i might do that with php Location command in my external php (ex. header('Location: http://' . $_SERVER.dirname($_SERVER).) it gives me back the first page (index.php native) inside the squezze box. 

I really dont know how to return back control and see my editing K2 form again(inside or out a squeezebox ot lightbox, i dont mind!)

Sorry i havent yet uploaded anything so i cant send a link. 

Any ideas how this can be made? Returning back from an external php to my K2 editing  Squeezeform ?

Thanks

Please Log in or Create an account to join the conversation.

  • Concerto Designs Inc.
  • Concerto Designs Inc.'s Avatar
  • Offline
  • Junior Member
More
13 years 5 months ago #96031 by Concerto Designs Inc.
Replied by Concerto Designs Inc. on topic Any way to disable item image lightbox?
Panagiotis:

Your situation is completely different (obviously) - I do not have much experience with modifying the K2 editor functionality, so I would not be much help. What exactly are you trying to accomplish with these revisions?

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #96032 by Panagiotis
Replied by Panagiotis on topic Any way to disable item image lightbox?
Well...

I ve made an external php script that   parses and imports a specific type of an xml file and does two things:

1) Creates a text file with info from xml

2) Creates an image from xml

 

The idea is this : these 2 fies (image and text) to be saved using the k2 editor in k2 items database. So i want to execute from inside k2 editor the external php script that will produce for me these files and also will inform the text fields in the screen of k2 editor. After that a "Save" from user and will be ok! 

 

By exec the script i want to inform the screen of k2 editor and not directly the database of K2 because i want to give the user the oportunity to see and alter the imported fields.

 

As i ve read to forums any external php script must have the joomla environment that is :

* Initialize Joomla framework */define( '_JEXEC', 1 );define('JPATH_BASE', dirname(__FILE__) );define( 'DS', DIRECTORY_SEPARATOR );require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );/* To use Joomla's Database Class */require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );//require_once ( JPATH_BASE .DS.'simplexml'.DS.'simplexml.class.php' );/* Create the Application *//*$mainframe =& JFactory::getApplication('appname', array('session' => false));*/$mainframe =& JFactory::getApplication('site');

 

I may have to keep this environment in my extrernal script cause i want to use Joomla session to set value to my 2 vars and return them back to k2 editor screen.

 

My difficulty is on how to return control to the k2 editor page (no matter if it is in squeezebox ) from external php script !

 

That's my main problem, 

Thank you for interesting!

 

 

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #96033 by innocence
Replied by innocence on topic Any way to disable item image lightbox?
Hi guys =)Is there some way to disable lightbox in just one (or more) K2 categories?

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #96034 by Panagiotis
Replied by Panagiotis on topic Any way to disable item image lightbox?
Hi Paul,

It depends in where you want to disable it. 

In editing or adding a new item the Squeezebox is declared into form.php and you might find into the php code.

The statement is something like this <a rel="{handler: 'iframe', size: {x: 600, y: 400}}" class="modal" href="...

 

I think that if you want to disable it when editing or adding an item and only for a specific category, you must have javascript function that will check with the onchange event the value for the category in the html control. Start by trying to find out the name of the html control that controls the categories in your form...

Please Log in or Create an account to join the conversation.

More
13 years 3 months ago #96035 by innocence
Replied by innocence on topic Any way to disable item image lightbox?
Thanks for the tip, Panagiotis!

I´ll start from what you say. I´m also thinking in the individual parameters that you can set on a category. I think the solution might be there...

Please Log in or Create an account to join the conversation.

More
12 years 2 weeks ago - 12 years 2 weeks ago #96036 by Teemu Peemu
Replied by Teemu Peemu on topic Re: Any way to disable item image lightbox?
Log in  or Create an account to join the conversation.