Techcon Cybernet

Thai (ภาษาไทย)English (United Kingdom)

Blog

blog

Displaying items by tag: joomla
Tuesday, 13 May 2014 19:27

K2 frontend editing in full screen

Many people has problem with K2 frontend editing in Joomla CMS. You may found the "Save" button on the front end saves the edits but doesn't close the lightbox window. Here is a solution to work with full screen not a modal pop-up, when you add/edit an item from frontend. We will open an editor in a new window. When save it will reload the parent window and close. When click a close button, it will close a child window.

The file for add an item;

modules/mod_k2_user/tmpl/userblock.php

The files for edit an item;

components/com_k2/templates/default/category_item.php
components/com_k2/templates/default/item.php

Or in case you have template override;

templates/YOURJOOMLATEMPLATE/html/com_k2/templates/YOURK2THEME/category_item.php
templates/YOURJOOMLATEMPLATE/html/com_k2/templates/YOURK2THEME/item.php

 

The files for save an item;

components/com_k2/templates/default/itemform.php

 

OK Let's start with the userblock.php;

Change from:

<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="/<?php echo $user->profile->addLink; ?>">

Change to:

<a target="_new" href="/<?php echo $user->profile->addLink; ?>">

 

Next, category.php and item.php.

Change from:

<a class="catItemEditLink modal"  rel="{handler:'iframe',size:{x:1000,y:550}}"

Change to:

<a class="catItemEditLink"  target="_new"

and

Change from:

<a class="itemEditLink modal"  rel="{handler:'iframe',size:{x:1000,y:550}}"

Change to:

<a class="itemEditLink"  target="_new"

 

Next, itemform.php

under

submitform( pressbutton );      

add

submitform( pressbutton );
                                setTimeout(function(){
                                         window.opener.location.reload();
                                         window.close();
                                },1200);   

 

and at

<td id="toolbar-cancel" class="button">
                        <a class="toolbar" href="#"; return false;">

Change to:    

<td id="toolbar-cancel" class="button">
                        <a class="toolbar" onclick="window.close();" return false;">
                

Published in Joomla
« June 2017 »
Mon Tue Wed Thu Fri Sat Sun
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Search Blog