Viewing 30 posts - 1 through 30 (of 37 total)
  • Author
    Posts
  • #431331

    Hi Josue!
    A few months ago you solved a problem concerning some portfolio pages on https://kriesi.at/support/topic/icon-fonts-dont-appear/
    Now I have to built a festival archive (1967 – 2014) with 3.600 portfolio items. In order to make it searchable and filterable, I’m using the Search & Filter Plugin. The plugin displays the search-results
    (1) as an archive-page or
    (2) using a shortcode in combination with a customized template.
    (1) I’m using ENFOLD ‘taxonomy-portfolio_entries.php’ and the results are well displayed on a new page: http://hofer-filmtage.com/testarchiv-a/
    (2) I’m using ENFOLD ‘taxonomy-portfolio_entries.php’ without get_header(); and get_footer(); as customized template. The results are displayed on the same page in a new container, but doesn’t work well. It seems like it’s building a grid, but cannot load the portfolio entries: http://hofer-filmtage.com/testarchiv-b/
    It would be very helpful, if you would have a look on that.
    Do you have an idea?
    Best regards
    Bernd

    #431899

    Hey Bernd!

    Can you paste the contents of taxonomy-portfolio_entries.php on Pastebin or Gist?

    Best regards,
    Josue

    #432643

    Hey Josue!
    Thanks for having a look.
    My customized template on the base of taxonomy-portfolio_entries.php: http://pastebin.com/7bzAX36b
    The template, which comes with the plugin: http://pastebin.com/0RMTTc2q
    Best regards
    Bernd

    #433049

    Hi,

    The grid is being built by this code:

                        <?php
     
                        $grid = new avia_post_grid(array(   'linking'       => 'ajax',
                                                            'columns'       => '3',
                                                            'contents'      => 'excerpt',
                                                            'sort'          => 'no',
                                                            'paginate'      => 'yes',
                                                            'set_breadcrumb' => false,
                                                    ));
                        $grid->use_global_query();
                        echo $grid->html();
     
                        ?>

    What’s the layout you want to achieve?

    Cheers!
    Josue

    #433075

    Hi Josue!
    Thanks, but the result is as similar as before: http://hofer-filmtage.com/testarchiv-b/
    The layout I want to achieve should look like the portfolio grid on http://hofer-filmtage.com/testarchiv-a/
    If you want, I would create a WP account, so you may check or test the template in the editor.
    Thanks and best regards
    Bernd

    #433231

    I see, yes, please hand me a WP administrator account via private reply.

    Best regards,
    Josue

    #433308
    This reply has been marked as private.
    #434574

    Hi Bernd!

    It doesn’t work because you’re assigning the grid query to the global query ($wp_query), which in this case is the page being shown. What you need to do, is use the $query variable (provided by the plugin).

    However, as the $entries variable is protected inside the grid class you’d need to create a public function similar to use_global_query, specifically for this use, something like this (config-templatebuilder/avia-shortcodes/portfolio.php):

    public function use_search_and_filter_query($query)
    {
    	$this->entries = $query;
    }

    And then in 7033.php:

    <?php
    
        $grid = new avia_post_grid(array(   'linking'       => 'ajax',
                                            'columns'       => '3',
                                            'contents'      => 'excerpt',
                                            'sort'          => 'no',
                                            'paginate'      => 'yes',
                                            'set_breadcrumb' => false,
                                    ));
    
        $grid->use_search_and_filter_query($query);
        echo $grid->html();
     
        ?>

    I’ve done this modification right now and it seems to work, check it.

    Regards,
    Josue

    #434741

    Hi Josue!
    Thanks so much – that’s really the perfect solution.
    We are totally excited. Everything works fine: searching, filtering, pagination, WPML
    Great work!
    Bernd

    #434743

    Hey Bernd!

    You’re welcome, make sure to backup all modified files so you can restore them in case of updating the theme.

    Regards,
    Josue

    #434746

    Hey Josue!
    Yes, o.k., I think it’s only concerning the ‘search-filter’-folder with my template and the code you added in the file config-templatebuilder/avia-shortcodes/portfolio.php.
    Cheers!
    Bernd

    #434924

    Hi,

    Correct, alternatively you could use a child theme and have these mods stored there instead on the parent theme.

    Also check:
    http://kriesi.at/documentation/enfold/add-new-or-replace-advanced-layout-builder-elements-from-child-theme/

    Cheers!
    Josue

    #998345

    Hi Josue,
    I have exactly the same problem and was happy to find your solution! But your code snippet for the function.php doesn´t work for me:

     public function use_search_and_filter_query($query)
    {
    	$this->entries = $query;
    }

    I already use a child theme. Is this the problem? Can you help?

    #998356

    Hi there,
    you’ll probably find the solution in REPLY # 434574 – I’ve added Josue’s snippet at line 968 in portfolio.php.
    Best regards

    #998364

    … yes – of course: I tried to use Josue’s solution! Problem is the code snippet for the function as mentioned in my post before #998345

    #998874

    Hi,

    The code Josue provided won’t work “out of the box” and is also not intended to be used in functions.php. It’s just a starting point for a custom php class. If you don’t know how to implement and use the code please hire a developer who can implement it for you.

    Best regards,
    Dude

    #999228

    … OK. But the only information I need is:
    On which line (in “config-templatebuilder/avia-shortcodes/portfolio.php”) should I paste Josue’s code snippet?

    Just this little Information will help. Can you please tell me the number of the line?

    #999258

    Hi,

    You can add it anywhere inside the “class avia_sc_portfolio”, i.e. below the “function shortcode_handler” which ends on line 431

    Best regards,
    Dude

    #999274

    … thanks Dude! But your suggestion causes  a syntax error. This is the portfolio.php with code snippet on line 427:
    https://pastebin.com/UJ2876g6

    #999526

    Hi,
    It seems like the line numbers are different. Based on the file here https://pastebin.com/UJ2876g6 you need to move the code to line 424. So make sure the curly bracket ( } ) on line 424 is AFTER this code

    
    
    public function use_search_and_filter_query($query)
    {
        $this->entries = $query;
    }
    

    Best regards,
    Dude

    #999686

    …. thanks again for your support. I have already placed the code before the curly bracket- see https://pastebin.com/VxhNU7eu
    But syntax error still exist.

    #999694

    Hi,

    I modified the code for you: https://pastebin.com/4we4UCnY – it was a character encoding issue with the > character. I also had to move the code one line up.

    Best regards,
    Dude

    #999705

    … great – the syntax error is gone – thanks!

    But also I try to do it the same way as Bernd (using ENFOLD ‘taxonomy-portfolio_entries.php’ without get_header(); and get_footer(); as customized template) it will not working.

    What I´ve done:
    1) Modify the ENFOLD portfolio.php like here: https://pastebin.com/4we4UCnY
    2) Modify SEARCH&FILTER results.php like here: https://pastebin.com/ZbMLs9Xz
    … do you have an idea what`s wrong?

    All the mods are in my child-theme:
    CHILD/shortcodes/portfolio/portfolio.php
    CHILD/search-filter/results.php

    In case you will have a closer look, you will find login credentials in private content – thanks in advance!

    #1001052

    … I don´t want to get impatient – but since 3 days I´m waiting for your answer. So please just let me know:
    Do you want to canceling your support?
    Or would you like help me further on?

    #1001263

    Hi there! We’ve built the page with Enfold Avia Layout Builder and S&F Shortcode. Please let me know, if you want to achieve exactly the same result. After that I’ll try to remember …
    Best regards
    Bernd

    #1001282

    Hey Bernd, thanks for vour willingness to help! And yes, his is exactly what I will do! The results of S&F should look like portfolio entries.
    What I´ve done:
    1) Modify the ENFOLD portfolio.php like here: https://pastebin.com/4we4UCnY
    2) Modify SEARCH&FILTER results.php like here: https://pastebin.com/ZbMLs9Xz
    … but with this mods I get no results at all (without this mods results will displayed). Do you have an idea what`s wrong?

    #1001359

    Hi frankeee, here our steps – as far as I can remember – but NOT using a child-theme:
    1) ADD NEW SEARCH FORM in S&F with “Results Method = Using a shortcode”. For example, the searchandfilter id is “253”.
    2) Add Joshua’s code at the end of portfolio.php

    //function that allows to set the query to an existing post query. usually only needed on pages that already did a query for the entries, like taxonomy archive pages.
    		//Shortcode uses the query_entries function above
    		public function use_global_query()
    		{
    			global $wp_query;
    			$this->entries = $wp_query;
    		}
    
    		/* Added by Josue */
    		public function use_search_and_filter_query($query)
    
    		{
    
    			$this->entries = $query;
    
    		}
    		/* End Added by Josue */
    
    	}
    }

    3) Create a S&F results php file, named with the S&F shortcode id, for example 253.php in the folder “search-filter”, put this folder in the enfold-folder:

    <?php
        $grid = new avia_post_grid(array(   'linking'       => 'ajax',
    	                                'columns'       => '3',
    						
                                            'contents'      => 'excerpt',
    
                                            'sort'          => 'no',
    
                                            'paginate'      => 'no',
    
                                            'set_breadcrumb' => false,
    
                                    ));
    
        $grid->use_search_and_filter_query($query);
    
        echo $grid->html();
    	
        ?>

    4) Put the S&F shortcodes for search fields and results in the text editor or in a customized widget area somewhere on the page:
    [searchandfilter id=”253″]
    [searchandfilter id=”253″ show=”results”]
    Good luck!
    Bernd

    #1002235

    Hey Bernd, thanks a lot or your detailed instructions !!!

    Unfortunately, I was not lucky. Although I renamed results.php into my-S&F-ID.php. Nevertheless the mods should also run in a child, I´ve done it directly in enfold – like you do. Anyway can someone of the enfold support team tell me if a public function will work in a child-theme?

    A public function like this:
    1) Own puplic function on line 424 of portfolio.php: https://pastebin.com/4we4UCnY
    2) Put the modified portfolio.php in CHILD-THEME/shortcodes/portfolio/portfolio.php
    3) Add this filter to the function.php:

    function reiselaender_func( $atts ){
        return get_field( 'reiselaender');
    }
    add_shortcode( 'reiselaender', 'reiselaender_func' );

    If this puplic function works – why does the following code snippet not showing any results?

    <?php
        $grid = new avia_post_grid(array(   'linking'       => 'ajax',
                                            'columns'       => '3',
                                            'contents'      => 'excerpt',
                                            'sort'          => 'no',
                                            'paginate'      => 'yes',
                                            'set_breadcrumb' => false,
                                    ));
        $grid->use_search_and_filter_query($query);
        echo $grid->html();
        ?>

    Do I have to put the S&F Search-ID anywhere? Filename with S&F Search-ID, like Bernd did, is not working for me.
    If someone will have a closer look, you will find login credentials in private content.

    #1002428

    Hi frankeee, have you already tried to add Josue’s code AT THE END of portfolio.php, like in our solution?

    #1002582

    Guten Morgen Bernd, yes but this will cause the error in portfolio.php:
    Cannot redeclare avia_post_grid::use_global_query() in /home/www/dev……/shortcodes/portfolio/portfolio.php on line 959

    Otherwise Dude´s suggestion (see #999694) will cause the error in results.php:
    Call to undefined method avia_post_grid::use_search_and_filter_query() in /home/www/dev/search-filter/results.php on line 26

    Even if I rename the results.php with my S&F-ID.php – I get the same error.

Viewing 30 posts - 1 through 30 (of 37 total)
  • The topic ‘Portfolio entries’ is closed to new replies.