×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: How do I change output appearance of custom fields

How do I change output appearance of custom fields 9 years 8 months ago #30462

  • Jonathan Perz
  • Jonathan Perz's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
How can I change the output appearance of the custom fields?



Currently, it kind of looks like the enclosed image. I would like to see the red starred area to be a horizontal layout below the comment. Where and how can I modify this?

Also, I tried changing the "Custom fields" text above field entry form (see red asterisk on attached file). I followed instructions to change it to "Additional Information" via another thread, but it did not work. I cannot find the COM_COMMENT_CUSTOM_FIELDS in the language override editor or in the actual language .ini file. Any suggestions?

Thanks.
Jonathan
Attachments:

How do I change output appearance of custom fields 9 years 8 months ago #30487

  • Josh Lewis
  • Josh Lewis's Avatar
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 89
  • Thank you received: 3
I would set the display of the fields to inline-block using CSS. So put in your template.css the following code:
.dl-horizontal > dd {
    display: inline-block;
}
.dl-horizontal > dt {
    display: inline-block;
}

This will make the custom fields display horizontally as one might expect.
The following user(s) said Thank You: Jonathan Perz

How do I change output appearance of custom fields 9 years 8 months ago #30505

  • Jonathan Perz
  • Jonathan Perz's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 3
  • Thank you received: 0
Thanks! That did the trick!

How do I change output appearance of custom fields 9 years 8 months ago #30510

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Hey Jonathan,
I can swear that I've already written the reply to your topic and now I'm shocked that it's actually not in the thread and I can't find it in the lazarus DB. Either my brain is playing games on me or technology has failed on me... wow...

So, I see that Josh told you what to do with display of the list. Now to have the fields horizontal you'll have to make a template override for:
components\com_comment\templates\default\default_form.php on line 216 you have this:
		<?php if($this->customfieldsForm->getGroup('customfields')) : ?>
			<div class="row-fluid offset1 span11 ccomment-actions hide">
			<strong><?php echo JText::_('COM_COMMENT_CUSTOM_FIELDS'); ?></strong>
				<?php foreach($this->customfieldsForm->getGroup('customfields') as $custom) : ?>
					<div class="ccomment-customfields-group">
						<?php echo $this->customfieldsForm->getLabel($custom->fieldname, 'customfields'); ?>
						<?php echo $this->customfieldsForm->getInput($custom->fieldname, 'customfields'); ?>
					</div>
				<?php endforeach; ?>
			</div>
		<?php endif; ?>
That is the part that you need to modify.

Also in your code you won't see:
<strong><?php echo JText::_('COM_COMMENT_CUSTOM_FIELDS'); ?></strong>

For some reason I've hardcoded Custom fields there and that is why you can't translate it.

Regards,
Daniel
The following user(s) said Thank You: Jonathan Perz

How do I change output appearance of custom fields 9 years 8 months ago #30511

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Ah, actually now so far I understand you just want to have the custom fields in horizontal line in the comment itself and not in the form. The code that I pointed to above is for the form.
The following user(s) said Thank You: Jonathan Perz
  • Page:
  • 1
Time to create page: 0.107 seconds