I’ve noticed that there’s quite a number of questions raised on showing attributes in a more flexible way on the listing page (the page showing details of a single listing). As far as I understand, the standard templates support for 3 display area’s which can be assigned per attribute (as mentioned in various topics).
I’ve also noticed that I could create a new template, and by saving the draft version, could have quite a variety of blocks available to include (these became only visible after saving it as draft).
This does, however, still not serve my needs, as I’m having quite a list of attributes (I’m planning to list puppies, with details of both the mother/father dog and details about the breeder -basically the vendor**-). This requires a custom template (see very basic example below).
My guess is that there are multiple ways of reaching this:
a) create a new block type (e.g. details mother dog) that I could add in the new template
b) create a new display area (e.g. page details mother dog) to which I can assign all attributes related to the mother dog (and to some extent I could give the attribute some formatting to present it properly, e.g. a file upload being shown as image).
c) create shortcodes for each attribute, so that I can include them anywhere in the template.
What would be your advise and are there any code snippets to which you can refer me to? I’ve noticed that more flexibility with display area’s has been planned/mentioned in topics originating from 2022… so I might have missed something (since I’m only using/testing hivepress now for 2 weeks - and I’m really impressed!)
** I’ve already noticed that it is possible to show details of a vendor on a listing detail page, based on another topic raised.
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 | Find top global talent
I’ve noticed there are several topics related to this question. In some of these topics (dating back from 2022) it was mentioned that this is being worked on (assigning attributes to -additional- display areas). Is there any plan to have this implemented soon? Otherwise it would indeed be necessary to consider hiring someone.
In recent updates, we added a new ternary display area. We plan to add more display areas in future updates. But, the layout for attributes that you need, in this version it will require a custom implementation.
Can you guide me a bit in what files I need to change to have another display area (actually make a copy of the existing ones) added in the admin backend and the template? Thanks!
If you’re familiar with coding, I recommend customizing the listing page template via the code snippets instead of the editor UI in HivePress/Templates, for example instead of creating custom areas you can simply show ay custom HTML (including the attribute values) in any location of the template https://www.youtube.com/watch?v=LkojYp-8uwY
Please describe some example (e.g. the attribute name and where you want to show it), I can post a sample code snippet.
Attached a quick overview of some of the attributes that I have. The picture should also give an idea of what it could look like (as also shown on the earlier shared picture). Basically I want to show a more tabular format with details below the main picture and description field.
I’ve also added more attributes from the vendor, which would also be very welcome to show on the listing page.
In this case, if you’re familiar with coding I recommend adding custom code snippets for the hivepress/v1/templates/listing_view_page filter hook. For example, you can insert a new block of “content” type with any content, and inside the callback function you add for the filter hook, you can get the current listing this way:
The attribute name can be checked in Listings/Attributes, in the Field Name input. You can find some sample snippets for templates here Search · user:hivepress templates · GitHub and on this forum if you search by “hivepress/v1/templates”.