Keyword

Create K2 item from the frontend in a separate window, not modal

More
5 years 9 months ago - 5 years 9 months ago #171328 by adil
Hi,
How to create the addition of K2 item from the frontend in a separate window, not in the modal? I wanted to make changes in the itemform.php file which is in a separate template for the category ... onar \ components \ com_k2 \ templates \ news, but it has a separate line for require_once (JPATH_SITE. '/ Administrator / components / com_k2 / views / item / tmpl / default.php ') ;.
Then I thought to create a video.php file at the same address, but it still refers to the default.php file. I need for each category and for each type of a particular menu to have its own input window with its own fields.

I repeat: the task is to make an input button for each category separately and with its own fields (for example: I do not need alias fields, tags, attachments, media and content, etc).
Last edit: 5 years 9 months ago by adil.

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

More
5 years 9 months ago #171334 by JoomlaWorks
Use sub-templates, e.g. /templates/YOUR_TEMPLATE/html/com_k2/cat1/itemform.php, /templates/YOUR_TEMPLATE/html/com_k2/cat2/itemform.php etc. (notice the change in cat1 and cat2).

The file must always be named "itemform.php".

However you MUST copy the source PHP/HTML code from /administrator/components/com_k2/views/item/tmpl/default.php first INTO each itemform.php file and then modify it as you wish.

Finally, create menu items of K2 "item edit form" type (jmp.sh/9cB0TWb) pointing to each different sub-template.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
5 years 9 months ago #171335 by JoomlaWorks
Keep in mind that you should use CSS to hide some fields that you don't want to show because they are mandatory in the form validation we do before saving content.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
5 years 9 months ago - 5 years 9 months ago #171343 by adil
Did as you wrote created sub-templates at templates \ ****** \ html \ com_k2 \ Videozal (videozal pic)
The menu showed that there should be that template (itemmenu pic), the system saw it, everything is ok. Now I want to make changes to the fields under my own names (itemform pic) , so that they are called according to the template, so that when you hide, the standard fields are not closed (videozalk2nav pic). After all, we need for each category to have its own input fields from the frontend. I made changes to the itemform.php code but all the same, the fields have not changed (frontend pic), if it's in the cache, I cleaned it up and updated it. I ask your help in solving this problem.
in the attachment I send you screenshots
Attachments:
Last edit: 5 years 9 months ago by adil.

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

More
5 years 8 months ago #171346 by JoomlaWorks
Did you copy the actual PHP/HTML code into your itemform.php files?

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
5 years 8 months ago - 5 years 8 months ago #171352 by adil
Hi,
Yes, I did copy the actual PHP/HTML code into your itemform.php files from /administrator/components/com_k2/views/item/tmpl/default.php.
I am waiting for further instructions.

You were able to view the screenshots?
Last edit: 5 years 8 months ago by adil.

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

More
5 years 8 months ago #171364 by JoomlaWorks
It was indeed a bug as the sub-template parameter (chosen in the menu item) was not properly passed to the view and thus K2 simply did not look into sub-templates.

I have fixed it here: github.com/getk2/k2/commit/53f2758e8b7ed40299d82bacb785987997aeac9a

Install K2 v2.9.1 (dev) from github.com/getk2/k2/archive/master.zip to make use of that fix.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
5 years 8 months ago - 5 years 8 months ago #171372 by adil
Hi,
Thank you very much, but it really helped (in the attachment screenshot). I have hidden all unnecessary fields through CSS. Now under each category I will make my own entry page.
Now the main question: how can you make the input window of materials not open to full screen, so that it is not modal but a neat window.
How can this be realized?
Attachments:
Last edit: 5 years 8 months ago by adil.

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

More
5 years 8 months ago #171375 by JoomlaWorks
Menu items pointing to the "item form" open in new windows already. Unless you mean something else...

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

More
5 years 8 months ago #171385 by adil
Hi,
I meant opening the input window of item not on the fullscreen mode but so that a separate window would appear.

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


Powered by Kunena Forum