FEATURE – Templates

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

These forums are closed to new replies / tickets. Please open a support ticket from our new Support page.

  • Author
    Posts
  • #4924
    Alan
    Spectator

    I have worked out generally how templates work by looking at your code (the documentation wasn’t too clear)

    In essence most template are retrieved by epl_get_template_part() which in turn calls locate_template() wand there is a path easypropertylistings so if you drop templates into a directory in your child theme you can override.

    You know that, of course and it works.

    But is there any reason the widget-content-listing.php isn’t in this scheme?

    line 370 of template-functions.php

    include(EPL_PATH_TEMPLATES_CONTENT.'widget-content-listing.php');

    I changed it to

    epl_get_template_part('widget-content-listing.php');

    And it appears to work fine picking up my custom template.

    Of course it is typical that I need to customise that layout 🙁

    Is this just an oversight? Can this go into the next release?

    Best regards, Alan

    #5073
    Merv Barrett
    Keymaster

    Thanks for letting me know Alan, this was an oversight and will include this fix in the next update of the plugin for you.

    #5102
    Alan
    Spectator

    Just FYI I discovered hy it uses an include not the function. widget-content-listing.php used some variables set in the widget setting that are not globalised so are not available when the template is called via teh function.

    Not 100% of the way out of that.

    #5107
    Merv Barrett
    Keymaster

    Correct Alan. We plan to add additional widget customisations in future releases. But tell me what are you trying to do with the widget? Is it the order information?

    #5165
    Alan
    Spectator

    Order was the main thing. I achieved reordering through relative / absolute positioning, which is working fine for me, but for some reason I’m not keen on using CSS to do that sort of thing, don’t know why, so my first instinct was to look at customising templates.

    #5167
    Merv Barrett
    Keymaster

    I agree totally
    — absolute positioning, which is working fine for me, but for some reason I’m not keen on using CSS

    Position is much better handled with templates. Even using JS I’m not a fan as it is slower as it needs to ask the DB for the order.

    I’m assessing a solution

    #5194
    Alan
    Spectator

    One approach to take is rather than have a list of specific arguments coming out of the widget / shortcode e.g. $d_price, $d_beds have one single array argument ($args) that is passed through to the templating system, similar to the way WordPress does with many functions e.g.
    $args=array(‘d_price’=>’on’,’d_beds’=>’off’);
    get_template(‘template’,$args)

    even allows for structuring arrays if you like
    e.g. get_template(array(‘display’=>array(‘beds’=>’on’,’excerpt’=>on), ‘images’=>array(‘h’=>123, ‘w’=>123))

    The template can extract $args into variables (simpler to follow) or use them as their array elements as required

    #5484
    Merv Barrett
    Keymaster

    Hi Alan, i’ve moved this topic to the feature requests

These forums are closed to new replies / tickets. Please open a support ticket from our new Support page.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Feature Requests’ is closed to new topics and replies.