Settings for widget type "GD > Listings"

This topic contains 7 replies, has 4 voices, and was last updated by  Kiran 5 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #492878

    Andreas Kirbach
    Expired Member
    Post count: 7

    It would be nice if the listing widget could

    1. only be displayed on detail pages which have a specified package
    2. filter listings by package

    Example
    We’ve got Basic, Premium and Premium+ packages.

    On Premium and Premium+ detail pages we do not want to show listings from competitors but detail pages for Basic listings should show Premium and Premium+ listings.

    We could probably achieve 1) by using a filter on

    widget_display_callback

    and 2) by using filters on

    geodir_widget_listings_query_args

    and

    geodir_filter_widget_listings_where

    , but that seems rather ugly and inefficient.

    #492894

    Alex Rollin
    Moderator
    Post count: 27815

    Most people just hide them with CSS. The package id is part of the body class on the page.

    Alternatively, you could edit your template to load that element only if the package is such and such ID or featured is checked.

    Have you considered that approach?

    #493013

    Paolo
    Site Admin
    Post count: 31206

    Or you could use the widget logic plugin…

    #493655

    Andreas Kirbach
    Expired Member
    Post count: 7

    Hiding Listings via CSS is a really bad idea – that just creates page bloat, espacially as listings can contain images and browsers will load them anyway even if the container is set

    display: none

    .

    I am a bit usure what

    Alternatively, you could edit your template to load that element only if the package is such and such ID or featured is checked.

    We’ve configured a listings widget for GD Sidebar. This widget should only display Listings of certain Package IDs on detail pages with certain package IDs.

    How could I achieve that by editing the template?

    #493657

    Andreas Kirbach
    Expired Member
    Post count: 7

    Ah, forgot to comment on Widget Logic: That Plug-in has not been updated since 2 years and uses eval() which should be avoided whenever possible as it is kinda dangerous.
    Furthermore I’d really like to keep the amount of plugins as low as possible.

    #493704

    Alex Rollin
    Moderator
    Post count: 27815

    Our doc about customizing templates is super straightforward, just copy the template you want into your theme and go for it.

    https://wpgeodirectory.com/docs-v2/faq/customizing/

    #493757

    Andreas Kirbach
    Expired Member
    Post count: 7

    Changing the template code is not supported.

    Quote from the linked document:

    we don’t provide support for customization

    Therefore the question remains:
    We’ve configured a listings widget for GD Sidebar. This widget should only display Listings of certain Package IDs on detail pages with certain package IDs.

    How can this be achieved in a supported way through admin GUI without modifying the templates and/or adding custom code (filters, etc.)?

    If it is not currently possible to do that (which seems to be the case to me), the suggestion is to add such a feature.

    #493811

    Kiran
    Moderator
    Post count: 7069

    Hi Andreas,

    The things you asking to achieve only possible by making core changes or via using hooks.

    Apart from core changes you can achieve by using hooks mentioned in your post #492878

    Regards,
    Kiran

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

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

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount