Tagged: portfolio ajax
-
AuthorPosts
-
June 1, 2017 at 10:43 am #802454
Hi, I have a portfolio grid and the setting is to use the ajax preview. But as I understand I should be able to overwrite the grid setting by setting a portfolio item to Define a Custom link and then that one item should not open in ajax preview, but go to the page. For some reason this does not work for me, it acts just the same and opens ajax preview. Am I missing something?
thanks
June 1, 2017 at 6:36 pm #802712Hey nfgraphicdesign,
Can you give us temporary admin access to your website in the private content box below, so that we can have a closer look?
Best regards,
VictoriaJune 1, 2017 at 6:59 pm #802725access is below in private
June 5, 2017 at 8:46 pm #804134Hi,
Please go to
Settings -> Permalinks save them again and let us know if it works.Best regards,
BasilisJune 5, 2017 at 10:17 pm #804195Hi,
This did not work, I have tried that already as well as again now.
Nathan
June 7, 2017 at 5:57 pm #805208Hi Nathan,
Well, when I checked Western Paradise Scottsdale item, custom link is not defined there. So obviously, it just does the ajax portfolio routine. I got the portfolio item to open the link in a new page. The settings are on the screenshot in private.
If you need further assistance please let us know.
Best regards,
VictoriaJune 7, 2017 at 8:43 pm #805278Hi Victoria,
That is because the Western Paradise one I do want to open in ajax. Most I want to open in Ajax. Only 6 Need to open in a custom link new page and I have set it for those, but they still open in Ajax.
Drew Duplex
Columbia 4 Plex Kamloops
Sunpeaks 4 Plex
Abby Place
Nicola 5-Plex Kamloops
9th Avenue TriplexI do notice these 6 properties title is in black instead of purple like the rest which means there is no link but the thumbnail still opens the Ajax. Shouldn’t both the thumbnail and the title get the custom link I have set?
Thanks,
NathanJune 12, 2017 at 7:43 am #806768Hi,
Thank you for the update.
The custom link option is not going to be applied when the AJAX Portfolio option is enabled. It’s possible but you have to modify the config-template-builder > avia-shortcodes > portfolio.php file. Look for this code around line 422:
$custom_link = get_post_meta( $the_id ,'_portfolio_custom_link', true) != "" ? get_post_meta( $the_id ,'_portfolio_custom_link_url', true) : false;
Below, add the following code.
$custom_link_class = get_post_meta( $the_id ,'_portfolio_custom_link', true) != "" ? 'grid-custom-link' : '';
Again, find this code around line 507:
$output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size, $image_attrs )."</".$link_markup[1].">";
And replace it with:
$output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='".$custom_link_class." grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size, $image_attrs )."</".$link_markup[1].">";
After that, edit the js > shortcodes.js file, look for the “avia_portfolio_preview” function. Look for line 1538-1539:
load_item: function(e) {
Below add this line of codes:
var target = $(e.currentTarget); if(target.is('.grid-custom-link')) return;
Remove browser cache or hard refresh after adding the modifications.
Best regards,
IsmaelJune 19, 2017 at 10:12 pm #810004Thank you for the instructions, I am having some problems though as it has stopped the thumbnails from loading and the slider.
For the shortcodes.js file, I have added the 2 lines of code as follows, please let me know if this is correct.
methods = { load_item: function(e) var target = $(e.currentTarget); if(target.is('.grid-custom-link')) return; { e.preventDefault(); var link = $(this), post_container = link.parents('.post-entry:eq(0)'), post_id = "ID_" + post_container.data('ajax-id'), clickedIndex = items.index(post_container);
June 19, 2017 at 10:15 pm #810005for portfolio.php
I have added the line here:
$custom_link = get_post_meta( $the_id ,'_portfolio_custom_link', true) != "" ? get_post_meta( $the_id ,'_portfolio_custom_link_url', true) : false; $custom_link_class = get_post_meta( $the_id ,'_portfolio_custom_link', true) != "" ? 'grid-custom-link' : '';
Also replaced line:
$output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size, $image_attrs )."</".$link_markup[1].">";
with line:
$output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='".$custom_link_class." grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size, $image_attrs )."</".$link_markup[1].">";
Have I missed something? Thanks again.
June 20, 2017 at 7:15 am #810211Hi,
You have to add the modification after the opening curly brace.
load_item: function(e) { var target = $(e.currentTarget); if(target.is('.grid-custom-link')) return;
Best regards,
IsmaelJune 23, 2017 at 11:25 pm #812336Hi Ismael,
I made that last change you gave and it did fix problem with the thumbnails and slider.
However the thumbnail still opens the ajax loader and the title under the thumb is not a link. Am I missing something?
I have reset the permalink and emptied my cache, but still need it to load the custom link.
thanks,
NathanJune 26, 2017 at 6:40 am #812893Hi,
Did you modify the portfolio.php file correctly? Please review the modification or post the FTP details here so that we can test it.
Best regards,
IsmaelJune 28, 2017 at 8:44 pm #814098Hi,
I believe I did modify both files correctly, if you could take a look, the FTP info is in private message portion.
Thank you.
Nathan
June 28, 2017 at 8:45 pm #814099the WordPress admin login I gave earlier is still valid if you need that as well.
Thanks,
NathanJune 30, 2017 at 6:16 am #814800Hi,
Are you sure that this is the correct FTP details? I remove everything from the portfolio.php file and it didn’t affect the site.
// http://www.nfgraphicdesign.ca/2tone-test/
Best regards,
IsmaelJune 30, 2017 at 8:24 pm #815156Hi,
yes this is the correct FTP, if you go to wp-content and rename the plugins or the themes folders the site doesn’t load I just tested that.
so why would changes in portfolio.php not do anything?
July 1, 2017 at 7:20 am #815269Hi,
I didn’t notice that you duplicated the “portfolio” shortcode. I deleted the “ORIG_portfolio.php” file and modified the original portfolio.php file a bit. Please remove browser cache or hard refresh before checking the page.
Note for moderators:
if(!empty($title_link)) { $output .= "<a href='{$title_link}' title='".esc_attr(strip_tags($title))."'>".$title."</a>"; } else { $output .= "".$title.""; }
.. replaced with:
if(!empty($title_link)) { $output .= "<a href='{$title_link}' title='".esc_attr(strip_tags($title))."'>".$title."</a>"; } else { $output .= "<a href='{$link}' title='".esc_attr(strip_tags($title))."'>".$title."</a>"; }
Best regards,
IsmaelJuly 4, 2017 at 9:22 am #816212that is working great on the thumbnails but I also need the titles to open the custom link and not do the ajax loader then it will be perfect.
July 5, 2017 at 5:25 am #816601Hi,
Thank you for the update. Please edit link 522.
$output .= "<a href='{$link}' title='".esc_attr(strip_tags($title))."'>".$title."</a>";
Replace it with:
$output .= "<a class='{$custom_link_class}' href='{$link}' title='".esc_attr(strip_tags($title))."'>".$title."</a>";
Best regards,
IsmaelJuly 5, 2017 at 10:11 pm #816902Great, thanks a lot for all of your help.
So for any future Enfold updates, I have to apply these changes again? Shouldn’t this be how the theme should work when you enter a custom URL?
I am just not sure what change you made to get it working, if you could let me know so I can make sure it doesn’t get broken on any new updates.
Thank you!
July 10, 2017 at 3:49 am #818515Hi,
There’s a way to override the shortcode in a child theme but we don’t recommend it because changes in the parent file, if there’s any, will not be applied.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.