Keyword

Custom Styling for K2 Item Form

  • robb rich
  • robb rich's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119231 by robb rich
Custom Styling for K2 Item Form was created by robb rich
K2 has a great way of allowing front-end users have the ability to make changes to their items, but the form is not very pretty and starts to look really cluttered when you have a long form. Is there a way to control the look of the form? For example, I need to put instructional text in some areas, but can't. I know I can adjust the css for things like 'header' sections, but that is still limiting.

it would be great to have the ability to expand all the form items into individual elements and then be able to build a nice form that isn't table based. is this possible?

thanks in advance
robb

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119232 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Custom Styling for K2 Item Form
Hello robb,

You can always override itemform.php like the way you override other parts of your template. And of course you can style it the way you want.

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

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

  • robb rich
  • robb rich's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119233 by robb rich
Replied by robb rich on topic Re: Custom Styling for K2 Item Form
Krikor
thank you for the response. I think where I get lost in the styling is I can't find a way to break the elements apart - for example, I am using a multiple extra fields plugin, and I would want to have those groups of extra fields separated. and all I can see in the itemform.php is the call to bring in the extrafields as one entire grouping. if I could find the way to separate those groups, as well as the other fields, then I should be able to set it up and style accordingly. do you have any direction on how I would do that?

thank you again
robb

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119234 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Custom Styling for K2 Item Form
Robb I don't think this is possible. If you are using a plugin for extrafields you need to override that particular plugin (if it gives you that option).

In your position I would use headers to separate them in the backend and use K2's native sorting.

PS. This is really hackish and dirty. If you have a fixed number of extrafields you can experiment with :nth-child() CSS value. Once again this is really hackish

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

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

  • robb rich
  • robb rich's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119235 by robb rich
Replied by robb rich on topic Re: Custom Styling for K2 Item Form
Krikor
the headers is something I am using now, but it has a character limit on it, and doesn't give me the ability to add a text area for instructions on the fields that are below that header.

on the front end of the site, I am using the k2 code to separate the extra fields into separate groupings by extra field alias which gives me greater control for how those display on the item.php - but I don't know if the same can be done on the itemform.php. if this is possible please let me know.

thanks again for your assistance
robb

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119236 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Custom Styling for K2 Item Form
In your position I would use var_dump($extraField);

From the elements of the object you will be able to construct your layout.

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

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

  • robb rich
  • robb rich's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119237 by robb rich
Replied by robb rich on topic Re: Custom Styling for K2 Item Form
I'm not sure I know where to do that. would I do that for each extra field line? so in my itemform.php I would insert 'var_dump($Address);' to get the address line?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119238 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Custom Styling for K2 Item Form
the var_dump should be used only with $extraField but it constructed with an AJAX call (it is availble only after you select the category).

You can experiment with sorting extrafiles by
$extraField->name

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