Keyword

Some questions on customising K2

  • Saejan Gracer
  • Saejan Gracer's Avatar Topic Author
  • Offline
  • New Member
More
7 years 3 weeks ago - 7 years 3 weeks ago #160862 by Saejan Gracer
Some questions on customising K2 was created by Saejan Gracer
Hi,

I'm using K2 as the CCK for my site, and am trying to customise some stuff but got stuck:

1. I have a custom "Add Item" form accessed via a menu item, however when author clicks "Edit Item" at the item page, the modal form that pops up is the default form. The custom itemform.php is placed in /templates/protostar/hmtl/com_k2/deals as an override. How do I get the Edit Item link at item page to display the same custom form as the "Add Item" form instead of the default form?

2. I have a custom category_item.php also in /templates/protostar/html/com_k2/deals as an override. I would like to get all items to be of uniform height. I've read in the forum that the class k2EqualHeights will achieve the effect, however the PHP code that generates the itemContainer class is not inside category_item.php. How can I achieve equal heights for the items in category view?

3. I would also like the content submitted by registered users to be automatically published without having to select the publish option, that means I will not display the publishing option, and by default when user clicks Save at Add Item page, the article will automatically be published, is that possible? I have the necessary permissions set.

4. In the itemform.php, I only want registered users to post to 1 category (I have more than 1 category, the others handle admin stuff and are not for users to submit into) but the code $this->lists lists all the categories. I want it to either not display (I tried to remove the code but the validation rule requires a category to be selected; I removed the validation rule but still it disallows posting due to no category being selected) or to display only 1 option (category id 3 only, instead of the whole list)

Thank you!
Last edit: 7 years 3 weeks ago by Saejan Gracer.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 3 weeks ago #160876 by Krikor Boghossian
Replied by Krikor Boghossian on topic Some questions on customising K2
1. You need to edit the default itemform.php
/templates/protostar/hmtl/com_k2/defautl/itemform.php

2. You can put it in the category.php file.

3. Yes it is possible. Make sure that the K2 User Group the users belong to, have the appropriate right.

4. In the K2 User Group's settings you can limit the categories the users have access to.

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

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

  • Saejan Gracer
  • Saejan Gracer's Avatar Topic Author
  • Offline
  • New Member
More
7 years 3 weeks ago #160888 by Saejan Gracer
Replied by Saejan Gracer on topic Some questions on customising K2
Hi Krikor,

Thank you for your replies!

1. Renamed the folder the default since I only have one editable category at the moment - doesn't work if more than one sub template requiring different edit item forms. [solved]

2. Achieved the results with a plugin by Digital Disseny. [solved]

3. I have set it in the administrator backend to allow the user group to publish items, but if I want whatever they submit to be automatically published - that means to set status to published in a save button onclick event, how can I do that?

4. I have set it in the administrator backend also to limit the user group access to only 1 category, but the field displays all categories in a dropdown list - I don't want them to see the names of the other categories, what should I change to $this->lists so that it doesn't fetch a list but instead only fetch one particular category?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 2 weeks ago #160979 by Krikor Boghossian
Replied by Krikor Boghossian on topic Some questions on customising K2
3. You can enabled the Managers to access the administrator area. This will ensure that managers publish items without the need to moderate them.

4. This setting is only for front-end editing.

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

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

  • Saejan Gracer
  • Saejan Gracer's Avatar Topic Author
  • Offline
  • New Member
More
7 years 1 week ago #161129 by Saejan Gracer
Replied by Saejan Gracer on topic Some questions on customising K2
Hi Krikor,

Thank you for your replies!

3. I don't want submitters to access the backend, so I'll leave the "Published" button as it is. [solved]

4. I'm migrating all other types of items to Joomla articles so only 1 category remains. [solved]

Further questions:

5. What should I do to the Social tab if I want a FaceBook Share button to appear on every item page?

6. I created modules to show certain items, however all items have a validity period, how do I make the K2 content modules NOT return items that are not currently valid? Eg. Item 1 is valid from 15 Mar till 31 Mar, while Item 2 is valid from 1 Feb to 28 Feb - I would like Item 2 (as well as all other items that are not valid) not to appear in the K2 content modules.

Thank you!

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 1 week ago #161158 by Krikor Boghossian
Replied by Krikor Boghossian on topic Some questions on customising K2
5. You need to enable the button in the category's settings.
6. If these items are unpublised by default they will not appear. Otherwise if you need them published but not shown in the module, you need to change each item's category or use a module which filters items based on other criteria.

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

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

  • Saejan Gracer
  • Saejan Gracer's Avatar Topic Author
  • Offline
  • New Member
More
7 years 6 days ago #161204 by Saejan Gracer
Replied by Saejan Gracer on topic Some questions on customising K2
Hi Krikor,

Thank you for your replies!

5. I mean in K2 -> Parameters -> Social -> Social Button Code, what am I supposed to insert? Is it the Facebook sharer code generated by Facebook? Or some other code?

6. Is there a way to filter the items before the K2 content module retrieves them? I have a custom default.php under mod_k2_content in my template, how should I include a filter criterion (eg. extraFieldValue[5] >= date("U")) so that the content module will only fetch items that match this criterion?

Thank you =)

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 days ago #161239 by Krikor Boghossian
Replied by Krikor Boghossian on topic Some questions on customising K2
5. This can be used to add social buttons which are not provided by default from K2. Since FB is enabled by default you can leave it blank.

6. Unfortunately this is not possible with the K2 Content module.
You will need a 3rd party extension.

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

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

  • Saejan Gracer
  • Saejan Gracer's Avatar Topic Author
  • Offline
  • New Member
More
6 years 11 months ago #161302 by Saejan Gracer
Replied by Saejan Gracer on topic Some questions on customising K2
Hi Krikor,

Thank you for your replies!

5. I have made the edits at item.php and gotten what I need. [solved]

6. Haven't come around to try filter extensions, but will reconfigure the modules in a way (perhaps by select specific items) to get non-expired items, will be more troublesome of course, but make do until I find a suitable solution. [KIV]

7. In my Add New Item form, I have extra fields that are of the Link type, but I do not want the "Text" and "Open in" to display in the form, which file should I edit to remove the two so that only "URL" remains?

8. Is there a way to incorporate a progress bar for image upload at Add New Item form?

9. Is there a way to display an error message upon saving if image uploaded exceeds file max upload size? I understand that at the beginning of itemform.php there are some validation code (to check title and category), what should I add to validate uploaded file size is not too big?

10. Is there a way to redirect submitter to the newly created page after submitter successfully submits content from the Add New Item form?

Thank you =)

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
6 years 11 months ago #161312 by Krikor Boghossian
Replied by Krikor Boghossian on topic Some questions on customising K2
7. You can use CSS overrides if we talking about the front-end in order to hide these elements.

8. While this is possible you will need to override the itemform.php file ( for the front-end ) and manually implement an AJAX image uploading script.

9. See above :) Without the AJAX script the validation will throw an error after the image has been uploaded.

10. Unfortunately by default no.

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