Placeholder on the add-listing page

This topic contains 8 replies, has 4 voices, and was last updated by  Naveen Giri 4 years ago.

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

Open Support Ticket
  • Author
    Posts
  • #538257

    Alexander Rottels
    Full Member
    Post count: 15

    I love the placeholders on the add-listing page, they make it easy for users to see what they should enter in the field.

    My URL field placeholders are not working. Can you take a look? I hav tried everything I could think of; your help in this matter would be great to have.

    Thanks

    #538264

    Kor
    Moderator
    Post count: 16516

    Hi Alexander,

    Thanks for your post. Try clicking on the “Show Advanced” option and you should see the placeholder option as shown in the attached image.

    #538269

    Alexander Rottels
    Full Member
    Post count: 15
    This reply has been marked as private.
    #538276

    Alexander Rottels
    Full Member
    Post count: 15
    This reply has been marked as private.
    #538550

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Alexander,

    the issue is coming from the Listimia theme.
    You can let them know about the issue to fix it in the theme.

    meanwhile, you can use this code snippet.

    
    
    /**
     * Get the html input for the custom field: url
     *
     * @param string $html The html to be filtered.
     * @param array $cf The custom field array details.
     * @since 1.6.6
     *
     * @return string The html to output for the custom field.
     */
    function custom_listimia_cfi_url($html,$cf){
    
        $html_var = $cf['htmlvar_name'];
    
        // Check if there is a custom field specific filter.
        if(has_filter("geodir_custom_field_input_url_{$html_var}")){
            /**
             * Filter the url html by individual custom field.
             *
             * @param string $html The html to filter.
             * @param array $cf The custom field array.
             * @since 1.6.6
             */
            $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
        }
    
        // If no html then we run the standard output.
        if(empty($html)) {
    
            ob_start(); // Start  buffering;
            $value = geodir_get_cf_value($cf);
    
            if ($value == $cf['default']) {
                $value = '';
            }?>
    
            <div id="<?php echo $cf['name'];?>_row"
                 class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details form-group">
                <label for="<?php echo $cf['name'];?>">
                    <?php $frontend_title = __($cf['frontend_title'], 'listimia');
                    echo (trim($frontend_title)) ? $frontend_title : ' '; ?>
                    <?php if ($cf['is_required']) echo '<span>*</span>';?>
                </label>
                <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
                <?php if(!empty($cf['placeholder_value'])){ echo 'placeholder="'.esc_html__( $cf['placeholder_value'], 'geodirectory').'"'; } ?>
                       value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield form-control"
                       oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'listimia'); ?>')"
                       onchange="try{setCustomValidity('')}catch(e){}"
                />
                <span class="geodir_message_note"><?php _e($cf['desc'], 'listimia');?></span>
                <?php if ($cf['is_required']) { ?>
                    <span class="geodir_message_error"><?php _e($cf['required_msg'], 'listimia'); ?></span>
                <?php } ?>
            </div>
    
            <?php
            $html = ob_get_clean();
        }
    
        return $html;
    }
    remove_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
    remove_filter('geodir_custom_field_input_url','listimia_cfi_url',10,2);
    add_filter('geodir_custom_field_input_url','custom_listimia_cfi_url',10,2);

    Regards
    Naveen

    #538693

    Rachid
    Expired Member
    Post count: 18

    Hello,
    It was a bug, thank you for reporting is.
    It’s fixed and the fix will be in the next release.

    I sent you a hotfix.

    Sorry for any inconvenience

    #538846

    Naveen Giri
    Moderator
    Post count: 1559

    Thanks Rachid.

    #539265

    Alexander Rottels
    Full Member
    Post count: 15
    This reply has been marked as private.
    #539267

    Naveen Giri
    Moderator
    Post count: 1559

    Hi Alexander,

    can you please create a new task for it. It seems the current task is already resolved.

    Kind Regards
    Naveen

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