HTML field new lines

This topic contains 14 replies, has 4 voices, and was last updated by  Paolo 8 years, 10 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #115721

    mb
    Buyer
    Post count: 151

    Hi,

    I have HTML field as a custom field. It works well when putting text inside, styling it, new lines etc. The problem is that the new lines do not appear on the front-end and I really need them to be there.

    Any ideas?

    Cheers.

    #115729

    Guust
    Moderator
    Post count: 29970

    URL and WP admin details please in a private reply so we can have a look.
    And details of the listing where you have that problem.
    Thanks.

    #115744

    mb
    Buyer
    Post count: 151

    Could it be possible because I am outputting it like that:

    echo $post->geodir_customhtmlfield;

    in a custom function in functions.php?

    Sending the login credentials with the next message.

    #115746

    mb
    Buyer
    Post count: 151
    This reply has been marked as private.
    #115800

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    the cutom field output is wrapped by a H2 tag which is a block tag.

    This is what you see in html source:

    
    
    <h2>hello
    
    &nbsp;
    
    some simple field here to come
    i cannot do anything else then just to put new lines
    
    kk
    
    kk</h2>

    Have your trying removing the h2 tags around it?

    Let us know,

    Thanks

    #115814

    mb
    Buyer
    Post count: 151

    Just removed the h2 and changed it with span. The result is the same.

    And without span – the same.

    FYI, I am just hitting enter on front-end/back-end to create the new lines, like every average internet user would do it, without being necessary to write html code.

    How a complete theme compatibility can be performed? Could it be anything related. I am using Headway Themes.

    #115823

    Paolo
    Site Admin
    Post count: 31206

    Ok, I got you now, the HTML field is to add html code.

    It isn’t a visual editor that will add html to the text.

    The only fields that have tinyMCE integrated as an option are the listings description and the events registration (must be enabled in GD >> Design >> Listings >> Add lsiting settings).

    If you want to have a description field above the tabs, you could hide the profile tab (unset it from old array and don’t set it again). Then use the same hook you used for that custom field to output

    the_content()

    and use a custom fields for the 1st tab instead.

    Let us know if this helps.

    Thanks

    #115912

    mb
    Buyer
    Post count: 151

    My bad explaining what I am trying to achieve using the HTML field.

    Ok, so no way to get another wysiwyg editor next to the one in the content 🙁

    All starts with the search query looking in the content field. When I give this field for business info like ‘Who we are’, people write amazing stuff there that has nothing to do with their business, and thus the location appear in the search where it doesn’t belong. That’s why I want to give another field for this information and keep the content field explicitly for putting exact business Services.

    That’s the whole point here.

    Any news about coming extensions for the search query? I know it is a complicated thing, but may be you will find an easy way to be able to integrate simple text fields from the custom fields and make searching the content optional?

    #115916

    mb
    Buyer
    Post count: 151

    It would be helpful just to be able to give more ‘scores’ to some businesses in the search. Is there currently any doc how much weight each of the search query included fields have – title, content, tags and categories?

    I would like to be able to give some extra weight for example to tags. Anything like this possible with some hooks/actions?

    Thanks.

    #116141

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi mb,

    This is the weighting of a general search:

    gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5

    There is a filter to be able to filter the order by query here: https://github.com/GeoDirectory/geodirectory/blob/master/geodirectory-functions/listing_filters.php#L471
    If you need more complicated ways to edit the query i would be happy to work with you to achieve that.

    Thanks,

    Stiofan

    #116165

    mb
    Buyer
    Post count: 151

    Thanks Stiofan,

    this is very helpful!

    I am mostly still working on the design. Then, I will put some real listings data, testing the results and I can give a sign then, when I have more output.

    Best

    #116166

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    No probs 🙂

    #116725

    mb
    Buyer
    Post count: 151
    This reply has been marked as private.
    #117107

    mb
    Buyer
    Post count: 151

    Hi,

    I managed to output the HTML field as I need it but it works only when I am pulling the fields values in a custom design for example.

    If someone else might be interested, just wrap the field output like that:

    
    
    
    echo wpautop( $post->geodir_customfieldhtml );
    #117165

    Paolo
    Site Admin
    Post count: 31206

    Thanks for sharing, I’ve forwarded your question to Stiofan.

    Thanks

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount