Customizing Attribute Display in HivePress Listing View

Hello HivePress Community,

I am currently working on customizing the display of certain text area attributes in the listing view of my HivePress theme. My goal is to reposition these specific attributes to appear just below the description field in the listing view. While I’ve successfully managed to move all attributes, I’m looking for a way to selectively move only certain ones.

Here’s a brief overview of what I’m aiming for:

  1. Selective Repositioning: I want to move only certain text area attributes (not all) to a new position below the description field in the listing view.
  2. Full-Width Display: Some of these attributes need to be displayed in full width, not in a column format, to enhance readability and layout.

So far, I’ve tried modifying the template via add_filter but ended up moving all attributes instead of specific ones. Also, I’m struggling to get these attributes to display in full width.

Could anyone guide me on how to:

  • Selectively move certain text area attributes below the description field?
  • Display these attributes in full width on the listing view page?

Any code snippets, tips, or guidance on this would be greatly appreciated. I’m somewhat familiar with PHP and CSS, so I’m open to trying out code-based solutions.

Move attribute code :

add_filter(
    'hivepress/v1/models/listing/fields',
    function( $fields ) {
        // Ajoute votre attribut personnalisé.
        $fields['inclus'] = [
            'type' => 'content', // ou le type approprié pour cet attribut.
            'label' => 'Ce qui est inclus',
        ];

        return $fields; // Ajout de cette ligne
    },
    1000
);
add_filter(
    'hivepress/v1/templates/listing_view_page',
    function( $template ) {
        return hivepress()->helper->merge_trees(
            $template,
            [
                'blocks' => [
                    'listing_description' => ['_order' => 70],
                    'inclus' => [
                        'type'   => 'part',
                        'path'   => 'listing/view/block/attribute',
                        '_order' => 60,
                    ],
                    'listing_attributes_secondary' => ['_order' => 80],
                    'listing_location' => ['_order' => 120],
                ],
            ]
        );
    },
    1000
);

/*  colonne attribut.

Sorry, there’s no simple code snippet for this, it would require a custom implementation. If customizations beyond the available features are required for your site, please consider hiring someone for custom work Fiverr - Freelance Services Marketplace

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.