Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @mungbean,

    Directorist already includes tons of custom-field types and very rich form builders. In most cases, this should serve your purpose. While Directorist is compatible with Pods and other plugins like that, there is no integration as of now, so the fields, field types can’t be used with Directorist.

    May I know what exactly you’re looking to do with PODS? So that I can guide you if it’s possible to achieve using Directorist.

    Regards,
    Mahdi.

    Thread Starter mungbean

    (@mungbean)

    I’d like to add a new section that has a POD paragraph or code input field type that supports shortcodes and stylized link previews (Visual Link Preview plugin).

    Directorist doesn’t appear to have a way to show shortcodes currently.

    • This reply was modified 4 years, 3 months ago by mungbean.

    Hi @mungbean,

    Enabling Shortcode for the custom text field isn’t much of a work. First, you need to enable field key for custom fields, copy-paste this on your theme’s functions.php:

    add_filter('directorist_custom_field_meta_key_field_args', function ($args) {
        $args['type'] = 'text';
        return $args;
    });

    And then go to the Directory Builder and take a note of the field_key of the custom text field that you added.

    Finally, override the template file for text.php (available under single/custom-fields) with this (replace ‘insert_the_field_key_here’ with the field key of yours):

    <?php
    /**
     * @author  wpWax
     * @since   6.7
     * @version 7.0.5.2
     */
    
    use function WpWax\Directorist\Gutenberg\do_shortcode_callback;
    
    if ( ! defined( 'ABSPATH' ) ) exit;
    ?>
    
    <div class="directorist-single-info directorist-single-info-text">
    
    	<div class="directorist-single-info__label">
    		<span class="directorist-single-info__label-icon"><?php directorist_icon( $icon );?></span>
    		<span class="directorist-single-info__label--text"><?php echo esc_html( $data['label'] ); ?></span>
    	</div>
    	<?php 
    	if($data['field_key'] == '_insert_the_field_key_here') { ?>
    		<div class="directorist-single-info__value"><?php echo do_shortcode( $value ); ?></div>
    	<?php }
    	else { ?>
    		<div class="directorist-single-info__value"><?php echo esc_html( $data['key'] ); ?></div>
    	<?php } ?>
    	
    </div>

    And that should do it. If you’ve multiple text fields which can expect shortcodes, you can modify this condition: if($data[‘field_key’] == ‘_insert_the_field_key_here’) to add those field keys as well.

    Details on template overriding are available here: https://directorist.com/documentation/directorist/developers-guide/template-override/

    Regards,
    Mahdi.

    • This reply was modified 4 years, 3 months ago by Mahdee.
    Thread Starter mungbean

    (@mungbean)

    Thanks, I will take a look!

    Also, is it possible display POD relationships on a Directorist listing?

    Hi @mungbean,

    I’m not very much familiar with this but if I’m not wrong, they do provide a shortcode to show fields (even if it is a relationship field), so you should be able to show it using the shortcode.

    I’m sorry if I’m not getting it correctly, would appreciate more details.

    Regards,
    Mahdi.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘PODS compatibility?’ is closed to new replies.