Keyword

Creating new article does not show category

  • Fernando
  • Fernando's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128383 by Fernando
I suppose this one is easy, but I've searched all K2 parameters and articles in this forum and found no answer.

Whenever I create a new article inside a category, in frontend, the "Category" field should be pre-filled with category name, but it is not. It shows "--- Select Category ---".

What must I do to have it pre-filled with category name? Can anyone help me?

Thank you for any help you can give me

J 2.5.20
K2 v 2.6.8

Fernando

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

More
9 years 11 months ago #128384 by Lefteris
Hi. The only way to do this is create a menu link to item form page. Then in the menu link settings you can set the pre selected category.

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

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

  • Fernando
  • Fernando's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128385 by Fernando
Hi Lefteris

Thank you for your reply.

That means I need to create a menu link for each one of the categories? Is that so, or I didn't understand exactly what you mean?

The problem is I have a few 100s categories...

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

  • Fernando
  • Fernando's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago - 9 years 11 months ago #128386 by Fernando
Is there any way to get it, besides creating one menu link for each category?

I'd like to have the same as is in basic Joomla, i.e., when I'm inside a category and create an article, it should show in "Category" the category where I'm in.

This is really important, because I have over 3000 sub-categories grouped in 300 categories, and I'm not expecting every user to select the correct category inside the create article form. Probably they will choose any category, maybe the first one in the list, not the correct one.

Any help?

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

More
9 years 11 months ago - 9 years 11 months ago #128387 by Lefteris
Then you will need to create template overrides and modify the add link to include the category id in the URL. The result URL should look like:
[code]
ADD_LINK?tmpl=component&catid=XX
[code]
Note that XX should be replaced with the actual category id value.

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

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

  • Fernando
  • Fernando's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128388 by Fernando
Thank you Lefteris

But in that case I should make that "XX" variable. Is it possible inside the template?

Another question, to insert an article it opens a modal window. Then, when finished, the modal window closes but the category screen is not refreshed. It seems nothing has been done until I refresh it manually. Is there a way to refresh it automatically after insertion finished?

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

More
9 years 11 months ago #128389 by Lefteris
Of course, the category is is available in the category.php layout. The variable that holds the id is:
<?php $this->category->id; ?>
Regarding your second question, the browser is refreshing the page when you close the modal. If the item is published you should see it. If it does not refresh at all then check that:
1. You are using the latest version of K2.
2. Check the browser console for javascript errors.

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

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

  • Fernando
  • Fernando's Avatar Topic Author
  • Offline
  • New Member
More
9 years 11 months ago #128390 by Fernando
Thank you very much for your help. I'll try to see all this.

Regards

Fernando

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

More
9 years 11 months ago #128391 by Lefteris
You are welcome.

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

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


Powered by Kunena Forum