Keyword

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

More
3 weeks 5 hours ago - 3 weeks 4 hours ago #171328 by adil
adil created the topic: Create K2 item from the frontend in a separate window, not modal
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: 3 weeks 4 hours ago by adil.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 3 hours ago #171334 by Fotis
Fotis replied the topic: Create K2 item from the frontend in a separate window, not modal
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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
3 weeks 3 hours ago #171335 by Fotis
Fotis replied the topic: Create K2 item from the frontend in a separate window, not modal
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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

More
2 weeks 6 days ago - 2 weeks 6 days ago #171343 by adil
adil replied the topic: Create K2 item from the frontend in a separate window, not modal
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: 2 weeks 6 days ago by adil.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 5 days ago #171346 by Fotis
Fotis replied the topic: Create K2 item from the frontend in a separate window, not modal
Did you copy the actual PHP/HTML code into your itemform.php files?


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

More
2 weeks 5 days ago - 2 weeks 5 days ago #171352 by adil
adil replied the topic: Create K2 item from the frontend in a separate window, not modal
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: 2 weeks 5 days ago by adil.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 4 days ago #171364 by Fotis
Fotis replied the topic: Create K2 item from the frontend in a separate window, not modal
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.


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

More
2 weeks 4 days ago - 2 weeks 4 days ago #171372 by adil
adil replied the topic: Create K2 item from the frontend in a separate window, not modal
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: 2 weeks 4 days ago by adil.

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

  • Fotis
  • Fotis's Avatar
  • Away
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 3 days ago #171375 by Fotis
Fotis replied the topic: Create K2 item from the frontend in a separate window, not modal
Menu items pointing to the "item form" open in new windows already. Unless you mean something else...


If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

More
2 weeks 3 days ago #171385 by adil
adil replied the topic: Create K2 item from the frontend in a separate window, not modal
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.

Moderators: william white