Advertisement:

Author Topic: Change font size of custom text above signature  (Read 2414 times)

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,713
  • There's someone in my head but it's not me.
Re: Change font size of custom text above signature
« Reply #20 on: January 22, 2018, 12:29:55 PM »
Grtting back to your original request, don't know why changing font-size in .custom_fields_above_signature doesn't work (for me, either), but this does -

Display.template.php

Code: [Select]

/// Any custom fields for standard placement?
if (!empty($message['member']['custom_fields']))
{
foreach ($message['member']['custom_fields'] as $custom)
if (empty($custom['placement']) || empty($custom['value']))
echo '
<li class="custom_fields">',  $custom['value'], '</li>';
}


index.css

Code: [Select]

.custom_fields
{
font-size: .65em;
}


I'm seeing three fields diplayed correctly.

Offline Gwenwyfar

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,049
  • Gender: Female
    • Gwenwyfar on GitHub
Re: Change font size of custom text above signature
« Reply #21 on: January 22, 2018, 03:26:19 PM »
It was working perfectly but now it only displays the first two custom fields?

Just realised the above code was working perfectly in Redsy theme but now misbehaving since I changed to default theme with responsive curve.
You're right, it does that. Maybe this should be submitted as a bug report.

Code: [Select]
if ($custom['placement'] != 2 || empty($custom['value']))
Removing $custom['placement'] != 2 ||  fixes this.

Offline pepa

  • Jr. Member
  • **
  • Posts: 183
Re: Change font size of custom text above signature
« Reply #22 on: January 22, 2018, 05:59:18 PM »
Grtting back to your original request, don't know why changing font-size in .custom_fields_above_signature doesn't work (for me, either), but this does -

Display.template.php

Code: [Select]

/// Any custom fields for standard placement?
if (!empty($message['member']['custom_fields']))
{
foreach ($message['member']['custom_fields'] as $custom)
if (empty($custom['placement']) || empty($custom['value']))
echo '
<li class="custom_fields">',  $custom['value'], '</li>';
}


index.css

Code: [Select]

.custom_fields
{
font-size: .65em;
}


I'm seeing three fields diplayed correctly.

Yes, thank you that works to change the font size.  I'm still only seeing two fields displayed i.e. two in poster block and the same two above the signature.

Offline pepa

  • Jr. Member
  • **
  • Posts: 183
Re: Change font size of custom text above signature
« Reply #23 on: January 22, 2018, 06:01:23 PM »
It was working perfectly but now it only displays the first two custom fields?

Just realised the above code was working perfectly in Redsy theme but now misbehaving since I changed to default theme with responsive curve.
You're right, it does that. Maybe this should be submitted as a bug report.

Code: [Select]
if ($custom['placement'] != 2 || empty($custom['value']))
Removing $custom['placement'] != 2 ||  fixes this.

Thanks again Gwenwyfar .... unfortunately still no luck, just seeing two fields displayed after removing the code you suggested?

Offline Gwenwyfar

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,049
  • Gender: Female
    • Gwenwyfar on GitHub
Re: Change font size of custom text above signature
« Reply #24 on: January 22, 2018, 06:08:55 PM »
I haven't checked if there is more of that code elsewhere, I removed it here for the one for above signature area and it is now displaying my 3 fields (it was only showing 2 before).

Could you attach your Display.template.php?

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,713
  • There's someone in my head but it's not me.
Re: Change font size of custom text above signature
« Reply #25 on: January 22, 2018, 09:02:58 PM »
Works fine for me in either location, with Display.template.php edited as above to remove field label, and new css class to reduce font.  I cannot replicate the two field glitch.


Offline pepa

  • Jr. Member
  • **
  • Posts: 183
Re: Change font size of custom text above signature
« Reply #26 on: January 22, 2018, 09:28:19 PM »
I haven't checked if there is more of that code elsewhere, I removed it here for the one for above signature area and it is now displaying my 3 fields (it was only showing 2 before).

Could you attach your Display.template.php?

display.template.php attached

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,713
  • There's someone in my head but it's not me.
Re: Change font size of custom text above signature
« Reply #27 on: January 22, 2018, 09:43:43 PM »
That file displays 3 fields in either location, with or without this code -

Code: [Select]

     if ($custom['placement'] != 2 || empty($custom['value']))


Are you sure all fields are configured correctly?


Offline pepa

  • Jr. Member
  • **
  • Posts: 183
Re: Change font size of custom text above signature
« Reply #28 on: January 22, 2018, 10:05:18 PM »
That file displays 3 fields in either location, with or without this code -

Code: [Select]

     if ($custom['placement'] != 2 || empty($custom['value']))


Are you sure all fields are configured correctly?

Yep ... amazing, that was it.  Show on topic view wasn't checked on the 3rd field.  For some reason it had become unchecked when I changed for Redsy theme.  I didn't physically do it, so I have no explanation.

Thank you both for all your help with this .... fantastic community here : )

Offline pepa

  • Jr. Member
  • **
  • Posts: 183
Re: Change font size of custom text above signature
« Reply #29 on: January 23, 2018, 02:02:46 AM »
Just one last comment on all of this ...

If I comment out the font size in .custom_fields_above_signature in index.css then the class that Sir Osis added i.e.
Code: [Select]
.custom_fields
{
font-size: .65em;
}

doesn't work or, at least, the text of custom fields displayed above the signature becomes approx twice the size, so there may be some bug operating here?  But no biggie all the problems I was encountering have been resolved thanks to the wonderful support here!

Offline Gwenwyfar

  • Customizer
  • Sophist Member
  • *
  • Posts: 1,049
  • Gender: Female
    • Gwenwyfar on GitHub
Re: Change font size of custom text above signature
« Reply #30 on: January 23, 2018, 06:19:05 AM »
Hmm, odd things going on in these fields. Mines are all checked to display.

Glad it's all sorted then :)

Quote
doesn't work or, at least, the text of custom fields displayed above the signature becomes approx twice the size, so there may be some bug operating here?
em is a percentage, so it should be reducing whatever font size it originally was. No idea why it would become larger though, maybe that area has a larger font size being inherited from somewhere.

Offline pepa

  • Jr. Member
  • **
  • Posts: 183
Re: Change font size of custom text above signature
« Reply #31 on: January 23, 2018, 07:25:27 AM »
Hmm, odd things going on in these fields. Mines are all checked to display.

Glad it's all sorted then :)

Quote
doesn't work or, at least, the text of custom fields displayed above the signature becomes approx twice the size, so there may be some bug operating here?
em is a percentage, so it should be reducing whatever font size it originally was. No idea why it would become larger though, maybe that area has a larger font size being inherited from somewhere.

Yes, my thoughts as well ... some inheritance happening I'm not aware of.  Thank you for all your help with this (and Sir Osis).  I was getting quite lost and frustrated but the two of you pulled me through, great outcome : )

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 7,713
  • There's someone in my head but it's not me.
Re: Change font size of custom text above signature
« Reply #32 on: January 23, 2018, 03:37:49 PM »
doesn't work or, at least, the text of custom fields displayed above the signature becomes approx twice the size

You have to change formatting for both.  Font-size for fields in poster info block are adjusted using new .custom_fields class.  That has no effect on fields displayed above signature, that's formatted  in .custom_fields_above_signature, you have to change both -

Code: [Select]

.custom_fields_above_signature
{
width: 98%;
clear: right;
padding: 1em 0 3px 0;
border-top: 1px solid #aaa;
line-height: 1.4em;
font-size: 0.65em;
}

.custom_fields
{
font-size: .65em;
}