Custom Form Field – File Upload (sidebar)

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

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

Open Support Ticket
  • Author
    Posts
  • #50972

    KB
    Buyer
    Post count: 72

    Hello GeoDirectory,

    Theme: GD Modern

    I am using the Custom Form Field “File Upload” to place a link in the sidebar for a restaurants menu (PDF only). I get it to work no problem, I was wondering if it is easily possible to have a default link name show instead of the name of the file itself (and the added part of the name that GD adds on)? Something like “Click Here for Our Menu” vs 1235_geodir_menu_link_Test_Menu_Upload.pdf

    Please see attached image as to what I am referring to if I did not explain very well.

    I only changed the image to show “Click Here for Our Menu” while using browsers Inspect Element.

    I thank you in advance for any help or information you can forward.

    #51058

    Paolo
    Site Admin
    Post count: 31206

    Hi KB,

    I’m looking into this with Stiofan, we wil llet you know asap.

    Thanks for your patience,

    #51061

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    please try this in your theme functions.php file :

    
    
    // Replace 'menu' in "geodir_show_geodir_menu" with the html varibale of your custom field
    add_filter("geodir_show_geodir_menu","myTheme_change_menu_title", 10,2);
    function myTheme_change_menu_title($html, $variables_array){
      if($parts = explode('target="_blank">',$html)){
        $html = $parts[0].'target="_blank">Click Here for Our Menu</a></div></div>';
      }
    return $html;
    }

    Let us know,

    Thanks

    #51062

    Paolo
    Site Admin
    Post count: 31206

    p.s. make sure to replace ‘menu’ in “geodir_show_geodir_menu” with the html varibale of your custom field…

    #51066

    KB
    Buyer
    Post count: 72

    Thank you Paolo . . .

    Exactly what I was looking for, worked beautiful.

    Thank you for the quick response and support . . . GREAT!

    #51067

    Paolo
    Site Admin
    Post count: 31206

    You are welcome 🙂 Thanks to Stiofan for the code snippet!

    #51068

    KB
    Buyer
    Post count: 72

    Many Thanks Stiofan . . . Cheers!

    #51073

    Paul
    Expired Member
    Post count: 171

    I was subscribed to this for just that snippet

    Will this be incorporated into the next release?

    #51075

    Paolo
    Site Admin
    Post count: 31206

    Hi,

    This is a snippet that can be added to your functions.php to modify the link anchor text of custom fields (between other things) using a built in GD hook.

    It already works.

    Thanks

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

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

Open Support Ticket