Keyword

User Extended Fields Plugin

  • David Raza
  • David Raza's Avatar Topic Author
  • Offline
  • New Member
  • Welcome to my presence!
More
10 years 3 months ago #136452 by David Raza
User Extended Fields Plugin was created by David Raza
Hi All

My goal is to add additional fields to K2 Users.
I have installed the User extended fields plugin and which is working apart from some language errors on the plugin management page.
I have also started to add additional fields to this plugin as I need quite a few!

The problem is rendering the HTML output for the form elements both on the admin side and frontend user account page.
They are just being output as very basic form elements.
Can somebody please tell me where I can control/edit this html output?

Note: Viewing the users profile on the frontend is fine and I have found the template for this.

Thanks in Advance.
DR

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #136457 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Plugin
Nice to hear that you fined the template.
The fields are presented in the frontend from the profile.php and register files.

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

  • David Raza
  • David Raza's Avatar Topic Author
  • Offline
  • New Member
  • Welcome to my presence!
More
10 years 3 months ago #136460 by David Raza
Replied by David Raza on topic User Extended Fields Plugin
Hi Krikor

Thanks for responding.

I have already found the following code in profile.php and register.php:
<?php foreach($this->K2Plugins as $K2Plugin): ?>
	<?php if(!is_null($K2Plugin)): ?>
	<tr>
		<td colspan="2">
		<?php echo $K2Plugin->fields; ?>
		</td>
	</tr>
	<?php endif; ?>
<?php endforeach; ?>

.. but how do I expand this to display the output in a table etc?
Sorry if I am being dumb and missing something obvious here.

Also, does this render the output/form in admin or is that seperate?

Thanks
DR

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #136468 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Plugin
This renders the form only in the front end.
The fields do render in a table cell.

You can try a <?php echo var_dump($K2Plugin->fields); ?>
to see all the object's elements so you can directly render fields.
You can achieve the same result however with CSS.

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

  • David Raza
  • David Raza's Avatar Topic Author
  • Offline
  • New Member
  • Welcome to my presence!
More
10 years 3 months ago #136482 by David Raza
Replied by David Raza on topic User Extended Fields Plugin
Hi

The var_dump just displays the same form fields again except for string(15339)"..." around them. Is this right?

Although they are rendered in a table cell, after that there is no formatting so just an ugly group of fields.
Is this how it should be from the original plugin or could there be an error somewhere?

Screenshots -

I apologise... my PHP is not so great and trial/error most of the time!

Thanks again
DR

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #136521 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Plugin
Hello David, I cannot see the screenshot

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

  • David Raza
  • David Raza's Avatar Topic Author
  • Offline
  • New Member
  • Welcome to my presence!
More
10 years 3 months ago #136540 by David Raza
Replied by David Raza on topic User Extended Fields Plugin
OOPS.

I used the imgur suggestion below...

2nd attempt:
[url=http://http://imgur.com/a/3Q5AX#0]imgur.com/a/3Q5AX#0[/url]

Should be imgur.com/a/3Q5AX#0
David

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #136547 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Plugin
So you are reffering to the backend.
You are posting to two different threads. This is counter productive, it will only get us confused.

Please keep in in one thread.

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

  • David Raza
  • David Raza's Avatar Topic Author
  • Offline
  • New Member
  • Welcome to my presence!
More
10 years 3 months ago #136550 by David Raza
Replied by David Raza on topic User Extended Fields Plugin
I am referring to the backend, frontend (edit profile) and registration pages.
Images are of backend and frontend edit pages.

Basically, the only area which IS formatted with this plugin is the profile display on the frontend.

I am just trying to figure out where I can edit the output of the plugin which renders the form fields for the above pages.

Apologies about posting to the other thread, I should have just pointed to this one.

As you have seen in the other thread I have managed to hack the core K2plugin so that the label and input fields are wrapped in rows/cells but as you have also rightly pointed out this is far from ideal!

I just can't seem to get my head around how the plugin can be modified... even after looking at other k2 plugins and core Joomla ones!!

DR

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #136610 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Plugin
If you hack the core plugin you might break other K2 plugins.
I will make a PR in github in K2's backend styling to sort this out.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #136620 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Plugin
Please apply this patch github.com/joomlaworks/k2/pull/226
and let me know if that works for you.

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

  • David Raza
  • David Raza's Avatar Topic Author
  • Offline
  • New Member
  • Welcome to my presence!
More
10 years 3 months ago #140200 by David Raza
Replied by David Raza on topic User Extended Fields Plugin
Hi Krikor

I added the css styles as per your patch and while this improved things a little, it is still a very simple block layout and lacks further formatting to make the labels/fields inline etc.

I have added some css to improve this but when I add a class to the xml file, the class is only being added to the input fields and not the label.
Is this correct?

Looking at the source I see the following:
<label id="address-lbl" for="address" class="">Address</label>
<input type="text" name="plugins-[userExtendedFieldsaddress]" id="address" value="" class="rw-input" size="40"/>

Do you know how I can add a class to the label through xml?

At the moment I am simply styling using the label and input classes but would like more control.

While I appreciate that the extended fields plugin is free, it would have made sense to have it output the same structure as the core k2 forms so that the look is consistent which is what I am trying to achieve.

Thanks
David

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 3 months ago #140231 by Krikor Boghossian
Replied by Krikor Boghossian on topic User Extended Fields Plugin
You can control the label by enhancing the css snippet I posted.
The two lines that where added control the plugin's input and label elements in the user's forms.

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


Powered by Kunena Forum