Hi, is it possible to link a portfolio from an external page?
In short, I would like my link on page B to link to a specific .pf present on page A (e.g. .pf-uielements">UI Elements) and open the right selection.
If is it possibile can you give me the right coding?
thank for help.
Regards.
Link a portfolio from an external page
11 replies · opened Oct 26, 2023
Hello,
This is definitely possible!
Simply use the portfolio-hash-filter.html Template. Make sure that you are using the JS Codes as provided in the bottom of this Template in your Custom Page and use the External Link as this: https://canvastemplate.com/portfolio-hash-filter.html#filter=.pf-icons . You can use the Filter Value according to your needs.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.
Hi, thank for help.
:)
Hi,
the js code works well and opens the right selection.
However, the anchor tag to the portfolio section is not working correctly.
That is, if you have the portfolio at the top of the page you have no problem linking to it directly and displaying it, but if the portfolio is in the middle or bottom of the page with some content above it, you necessarily have to scroll down the page to find the portfolio if you link to it from another page.
If you have solutions to make the anchor tag work correctly so that it links to the right location of portfolio inside a page, that would be great.
Hello,
The Codes provided is just for the Filter Functionality. In order to add Scroll to Anchor functionality, you will need to further add Customized Codes. Unfortunately, this feature is currently not available within the Default Templates. We will surely consider adding this in Our Future Updates and will send you a Notification once this is available. And since, currently Customization related Support is not included with the License according to the Item Support Policy: https://themeforest.net/page/item_support_policy . You will need to manually code this or Hire Us to help you out with Customizations.
Thanks for Understanding.
Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.
okay thank you.
Ok, I tried to edit the js but I can't get it to do what I want. So hiring you to have this function is the only option left.
How do I go about hiring you?
Do I have to sign up here?
Or is it enough to simply pay for 1 Canvas Customizations?
Allow us 15 minutes. We will do this for you for Free. :)
Consider using the Template attached to this reply.
Thanks for the code!
However, it doesn't work well if I insert the "infinite scroll button" in the portfolio +_+:
This is the code I have used:
<!-- JavaScripts
============================================= -->
<script src="js/plugins.min.js"></script>
<script src="js/functions.bundle.js"></script>
<!-- HashChange JS -->
<script src="js/plugins.hashchange.js"></script>
<!-- Portfolio Script
============================================= -->
<script>
jQuery(window).on( 'load', function(){
var $container = jQuery('#portfolio');
$container.isotope({ transitionDuration: '0.65s' });
function getHashFilter() {
var hash = location.hash;
// get filter=filterName
var matches = location.hash.match( /filter=([^&]+)/i );
var hashFilter = matches && matches[1];
return hashFilter && decodeURIComponent( hashFilter );
}
var isIsotopeInit = false;
function onHashchange() {
var hashFilter = getHashFilter();
if ( !hashFilter && isIsotopeInit ) {
return;
}
isIsotopeInit = true;
// filter isotope
$container.isotope({ filter: hashFilter });
// set selected class on button
if ( hashFilter ) {
jQuery('.grid-filter li').removeClass('activeFilter');
jQuery('.grid-filter li').find('[data-filter="' + hashFilter + '"]').parent('li').addClass('activeFilter');
setTimeout( function(){
var sectionOffset = SEMICOLON.Core.offset(document.querySelector(hashFilter)).top;
SEMICOLON.Core.scrollTo((sectionOffset - 180), 1250);
}, 1000);
}
}
jQuery(window).on( 'hashchange', onHashchange );
// trigger event handler to init Isotope
onHashchange();
jQuery('.grid-filter a').click(function(){
jQuery('.grid-filter li').removeClass('activeFilter');
jQuery(this).parent('li').addClass('activeFilter');
var selector = jQuery(this).attr('data-filter');
$container.isotope({ filter: selector });
var filterAttr = jQuery( this ).attr('data-filter');
location.hash = 'filter=' + encodeURIComponent( filterAttr );
return false;
});
});
</script>
<!-- Infinite Scroll -->
<script src="js/plugins.infinitescroll.js"></script>
<!-- Portfolio Script
============================================= -->
<script>
jQuery(window).on( 'load', function(){
var $container = jQuery('.grid-container');
$container.infiniteScroll({
path: '.load-next-portfolio',
button: '.load-next-portfolio',
scrollThreshold: false,
history: false,
status: '.page-load-status'
});
$container.on( 'load.infiniteScroll', function( event, response, path ) {
var $items = jQuery( response ).find('.portfolio-item');
// append items after images loaded
$items.imagesLoaded( function() {
$container.append( $items );
$container.isotope( 'insert', $items );
setTimeout( function(){
$container.isotope('layout');
SEMICOLON.Core.runModules();
}, 1000 );
});
});
});
</script>Hello,
Thanks for your Patience!
These codes will require Additional Customizations. Unfortunately, as mentioned earlier, Customization related requests are not supported at the moment. We will send you an Email shortly where we can discuss any further requirements.
Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.
Have the same question, or something new?
Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.
Reply on the dashboard