Custom field description

This topic contains 12 replies, has 4 voices, and was last updated by  Kiran 7 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #366302

    marktowers
    Buyer
    Post count: 171

    Hi,

    I want to add an “help” icon for certain fields on the add listing form and thought it would be a good idea to use a hyperlinked font-awesome in the field description. This works fine for descriptions in the language file, however, if the field is a custom field (e.g. categories) it doesn’t like the hyperlinked font-awesome code.

    So, for example, I added this code but it doesn’t stick:-

    <a target="_blank" href="../add-a-listing-guide/#guide-import"><i class="fa fa-info-circle" aria-hidden="true"></i></a>

    Any suggestions as to how I achieve this?

    #366319

    Kor
    Moderator
    Post count: 16516

    Hi Mark,

    Have you tried adding the fontawesome icon directly using custom CSS? Give it a try and let us know if it works.

    Example

    
    
    div#geodir_claimed_row:before {
        content: "\f006";
        font: normal normal normal 15px/1 FontAwesome;
    }
    #366586

    marktowers
    Buyer
    Post count: 171

    Hi,

    I’ve given it a go but unfortunately I don’t think it’ll work for me.

    I tried a few variations, including :-

    
    
    .geodir_placecategory_row :before {
        content: "\f05a";
        font: normal normal normal 15px/1 FontAwesome;
    }

    This did nothing.

    
    
    .geodir_message_note:before {
        content: "\f05a";
        font: normal normal normal 15px/1 FontAwesome;
    }

    This does add the fontawesome icon, however, it shows on all field notes, but I only want it to appear on the ones I specify.

    The other issue is I can’t see how we would be able to add a hyperlink, which is essential as I want to link through to the relevant section on a help/user’s guide.

    Any other suggestions greatly appreciated.

    #366625

    Paolo
    Site Admin
    Post count: 31206

    Please explain exactly what you are trying to do possibly with a screenshot and we will provide the correct CSS.

    Thanks

    #366653

    marktowers
    Buyer
    Post count: 171

    Hi Paolo,

    The intention is to have a help icon (using font-awesome) on certain fields that will link through to relevant help info (on a user guide page.) So, for example, I would have this on categories, address, images etc.

    I felt it was best to place this after the note below certain fields. It is possible to achieve when the field note is in the functions.php file (I have a note for Social Import) or if the note is in a language file. However, a few field notes are in the custom field settings. It was the latter I was trying to address. I need the link to be different for each note as I want it to link to different information on my user guide.

    I’ve mocked up an example of what I want it to look like.

    Hope this makes sense.

    #366743

    Paolo
    Site Admin
    Post count: 31206

    I’ve flagged this for the develpoers, I hope there is a hook for that, otherwise I’m sure they’ll have an alternative solution for you. They’ll reply on Monday though, now they are off.

    Thanks

    #366896

    marktowers
    Buyer
    Post count: 171

    Ok, thanks Paolo.

    I look forward to receiving their advices.

    Mark

    #367028

    Paolo
    Site Admin
    Post count: 31206

    I just thought of 1 thing, if doing it via translation file works, why don’t you do it for all fields that way?

    All fields have a default description and all text string can be modified via translation files…

    Let us know,

    Thanks

    #367120

    Kiran
    Moderator
    Post count: 7069
    #368098

    marktowers
    Buyer
    Post count: 171

    Hi Paolo and Kiran,

    As I don’t quite understand how the hook approach would work I opted for Paolo’s approach instead.

    However, I found that if I add a default description (e.g. for Category) in to the geodirectory language file this doesn’t work (whether I leave the description blank on the custom field or not.)

    Taking Category as an example, there seem to be a couple of possible places to update the description:-
    line 4943 (to replace “SELECT listing category FROM here. SELECT at least one CATEGORY”), or
    line 7343(t replace “Select listing category from here. Select at least one category”)

    As mentioned above, neither worked. Any thoughts as to why the default description doesn’t show?

    Not: I did try the approach of changing the field title instead, however, found out that changing this for category and address had the negative effect of the font awesome icon also appearing on listing details (because the same field names are used there.)

    #368489

    Kiran
    Moderator
    Post count: 7069

    Hi Mark,

    > However, I found that if I add a default description (e.g. for Category) in to the geodirectory language file this doesn’t work (whether I leave the description blank on the custom field or not.)
    <
    You have re-saved category field with empty description, so now category description becomes empty.
    If you are using default field description saved then you can translate it directly via .po file translation. But if you have changed field description and saved then you should use our custom DB field translation method.
    For this you have to first save field description from fields settings then via running GeoDirectory -> GD Tools -> Load custom fields translation will adds new description texts to db-language.php file.
    Now you can able to update your .po file to include new description texts into .po file for translation purpose.
    See more about how to translate custom fields https://wpgeodirectory.com/docs/translating-custom-fields/

    > As mentioned above, neither worked. Any thoughts as to why the default description doesn’t show?
    <
    You have re-saved category field with empty description, so now category description doesn’t show.

    FYI: I checked in and the way Paolo suggested works fine that you asking to about.
    Ex: My category description saved “Select listing category from here. Select at least one category” and i translated to it “Select listing category from here. Select at least one category. <i class=”fa fa-info-circle” aria-hidden=”true”></i>
    Now category description showing info icon with link to page.

    Let us know.

    Thanks,
    Kiran

    #369038

    marktowers
    Buyer
    Post count: 171

    Hi Kiran,

    That’s great – I’ve now got it working how I want it.

    cheers,
    Mark

    #369040

    Kiran
    Moderator
    Post count: 7069

    Thank you for letting us know.

Viewing 13 posts - 1 through 13 (of 13 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket