- Posts: 5
COMMUNITY FORUM
How do I add a parameter to category K2 back-end?
- lexx006
-
Topic Author
- Offline
- New Member
Less
More
11 years 8 months ago - 11 years 8 months ago #118859
by lexx006
How do I add a parameter to category K2 back-end? was created by lexx006
Hello everybody!
I need to add a parameter to category in K2 back-end in order to use it in a view.
I've tried to add one:
<param name="num_leading_items_added" type="text" size="4" default="10" label="K2_LEADING_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LEADING"/>
to
components\com_k2\views\itemlist\tmpl\category.xml
and
administrator\components\com_k2\models\category.xml
but I still can't see the parameter in a category in K2 back-end.
How can I add a parameter?
Thanks for advance!
I need to add a parameter to category in K2 back-end in order to use it in a view.
I've tried to add one:
<param name="num_leading_items_added" type="text" size="4" default="10" label="K2_LEADING_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LEADING"/>
to
components\com_k2\views\itemlist\tmpl\category.xml
and
administrator\components\com_k2\models\category.xml
but I still can't see the parameter in a category in K2 back-end.
How can I add a parameter?
Thanks for advance!
Please Log in or Create an account to join the conversation.
- Stefanos Mountrakis
-
- Offline
- New Member
Less
More
- Posts: 8
11 years 8 months ago #118860
by Stefanos Mountrakis
Replied by Stefanos Mountrakis on topic Re: How do I add a parameter to category K2 back-end?
You can create an extra field without changing core files
1) Create a folder under /plugins/k2 named catField, inside there
2) Create a file catField.php
1) Create a folder under /plugins/k2 named catField, inside there
2) Create a file catField.php
Please Log in or Create an account to join the conversation.
- lexx006
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 8 months ago - 11 years 8 months ago #118861
by lexx006
Replied by lexx006 on topic Re: How do I add a parameter to category K2 back-end?
Hi,
Thanks for the reply.
Sorry but I need to have PARAMETER not an Extra field. haha
E.g. - Items count to show. Later I can use this parameter in view.html.php
Thanks for the reply.
Sorry but I need to have PARAMETER not an Extra field. haha
E.g. - Items count to show. Later I can use this parameter in view.html.php
Please Log in or Create an account to join the conversation.
- Stefanos Mountrakis
-
- Offline
- New Member
Less
More
- Posts: 8
11 years 8 months ago #118862
by Stefanos Mountrakis
Replied by Stefanos Mountrakis on topic Re: How do I add a parameter to category K2 back-end?
yes... this is an extra field created inside of a category item not inside of an item. You can retrieve inside of view.html.php since its stored as a plugin
Please Log in or Create an account to join the conversation.
- lexx006
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 8 months ago #118863
by lexx006
Replied by lexx006 on topic Re: How do I add a parameter to category K2 back-end?
Hi,
I tried as you said before but with no success. I can't see any new fields when I open a category layout in back-end.
I need to have it like this:
$params = K2HelperUtilities::getParams('com_k2');
$myparam = $params->get('myparam');
It is possible?
I tried as you said before but with no success. I can't see any new fields when I open a category layout in back-end.
I need to have it like this:
$params = K2HelperUtilities::getParams('com_k2');
$myparam = $params->get('myparam');
It is possible?
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
11 years 8 months ago #118864
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Re: How do I add a parameter to category K2 back-end?
Hello lexx006,
Its possible, but it is not recommended to hack the core file, the way StV explained is recommended.
The field will appear below the editor area, not on the right pane.
Its possible, but it is not recommended to hack the core file, the way StV explained is recommended.
The field will appear below the editor area, not on the right pane.
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- lexx006
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 5
11 years 8 months ago #118865
by lexx006
Replied by lexx006 on topic Re: How do I add a parameter to category K2 back-end?
Hi Mohamed,
Thank you for the reply!
Yes, I got it, I looked for the field on the left side below the WYSIWYG but there's no filed there.
Perhaps I did something wrong. haha
Thank you for the reply!
Yes, I got it, I looked for the field on the left side below the WYSIWYG but there's no filed there.
Perhaps I did something wrong. haha
Please Log in or Create an account to join the conversation.