- Posts: 5
COMMUNITY FORUM
Creating new article does not show category
- Fernando
-
Topic Author
- Offline
- New Member
Less
More
11 years 1 week ago #128383
by Fernando
Creating new article does not show category was created 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
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 week ago #128384
by Lefteris
Replied by Lefteris on topic Re: Creating new article does not show category
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.
Please Log in or Create an account to join the conversation.
- Fernando
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 1 week ago #128385
by Fernando
Replied by Fernando on topic Re: Creating new article does not show category
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...
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
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 1 week ago - 11 years 1 week ago #128386
by Fernando
Replied by Fernando on topic Re: Creating new article does not show category
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?
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 week ago - 11 years 1 week ago #128387
by Lefteris
Replied by Lefteris on topic Re: Creating new article does not show category
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.
[code]
ADD_LINK?tmpl=component&catid=XX
[code]
Note that XX should be replaced with the actual category id value.
Please Log in or Create an account to join the conversation.
- Fernando
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 1 week ago #128388
by Fernando
Replied by Fernando on topic Re: Creating new article does not show category
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?
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.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 1 week ago #128389
by Lefteris
Replied by Lefteris on topic Re: Creating new article does not show category
Of course, the category is is available in the category.php layout. The variable that holds the id is: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.
<?php $this->category->id; ?>
1. You are using the latest version of K2.
2. Check the browser console for javascript errors.
Please Log in or Create an account to join the conversation.
- Fernando
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 1 week ago #128390
by Fernando
Replied by Fernando on topic Re: Creating new article does not show category
Thank you very much for your help. I'll try to see all this.
Regards
Fernando
Regards
Fernando
Please Log in or Create an account to join the conversation.
- Lefteris
-
- Offline
- Platinum Member
Less
More
- Posts: 8743
11 years 4 days ago #128391
by Lefteris
Replied by Lefteris on topic Re: Creating new article does not show category
You are welcome.
Please Log in or Create an account to join the conversation.