Load everything from within a specific div

Permalink Browser Info Environment
Hi Tony, first of all congrats on this awesome block, it really is awesome. The usages are endless and I'll be sure to review very favorably shortly.

I was just wondering if its at all possible to load the contents of a div via ID or Class? My understanding is that currently it can only be load from a block area or full page. The block area option is suitable for basic usages however it is limiting if you are trying to load in more complex structures. The full page option was an easy fix for me but it also refreshes the menu which gives a flickering appearance during load.

Being able to load the content from within a specific div would solve my problems and I suspect help others create masterpieces loaded in with Ajax.

I look forward to your response... I'm happy to make changes to the block myself but would just need some pointers if possible.

Richard.

Type: Discussion
Status: New
mobius2000
View Replies:
Tony replied on at Permalink Reply
Tony
no, currently you can specify the area you wish to load, but not one particular div within that area. if you'd like to add functionality to do that, I'd recommend doing it within the javascript, in the ajax callback function. You could add the response markup to a newly created element (not inserted anywhere on the page), and then using something like $(yourNewElement).find('div.myDiv') to scan that resulting markup for the matching elements. best of luck.
freestylemovement replied on at Permalink Reply
freestylemovement
Hi,
Has anyone found the solution to this? i have an autonav on the sidebar that i would like to load Main content from, but the CSS selector #sidebar a doesn't read it. i've tried targeting other DIVs but this doesn't always work either.. I came upon this so i thought i might see if there has been a solution to this yet. Thanks in advance
freestylemovement replied on at Permalink Reply
freestylemovement
Just to be clear, what I'm trying to do does not necessarily entail reloading of the page. i have an auto-nav block in the sidebar area with an accordion template to define categories in which to nest sub pages, and i also have a date navigation add on.

the date navigation works as expected, with top level categories being months, but the accordion menu only works on top level categories, which i want disabled. the sub pages in this add on do not seem to work for the paging add on.

http://ladyapples.com/index.php?cID=214...
Tony replied on at Permalink Reply
Tony
to do this you'll probably have to make your navigation preload all of the hierarchy of pages, with some of them hidden that don't current apply to the current selected page. And then when a new page loads, you have to hook into the callback event of the rapid paging package to trigger the opening of the navigation to the new state. Since the date nav was one of the standard ones I included that functionality by default, but you'll have to code up that same behavior if you want it to work the same way with other navigation blocks.
freestylemovement replied on at Permalink Reply
freestylemovement
I see, so auto-nav block isn't configured to work with rapid paging for sub-levels ? i'm curious if it's easy to explain which parts were modified, and how come the date nav and auto-nav don't have the same structure that would allow for this..

im not sure if this would be beyond my ability, but since date navigation already works, is there an easier way to modify this block?

all i need is 3 categories, which are fixed pages with composer pages adding to each 3 category. these pages are hidden from the top level nav.

i would want to delete the function which creates new months, and instead shows only 3 categories.

i could also do it by loading 3 instances of this custom block if it's easier- a page list that is collapsible like date-nav, and works with rapid paging in a simple way.
Tony replied on at Permalink Reply
Tony
This code snippet may be helpful. It's how the rapid paging add-on works with the date-nav and the auto-nav to select the current page. So you'd want to hook into the rapid_page_load event in the same way, and then use the info past through in the 'data' object to select the current page within your navigation. Note that for this approach to work, all of the pages need to be already preloaded within the DOM, but then you can just hide/show them as needed:


//update standard navigation menus on page load
$(document).bind('rapid_page_load', function(e, data) {

var requestURL = data.url.replace(/index.php\//i,'');

//standard auto-nav
$('ul.nav li a').each(function(){
//var el = $(this);
var parent = $(this.parentNode);
var linkURL = this.href.replace(/index.php\//i,'');
if( parent.hasClass('selected') && linkURL!=requestURL ) parent.removeClass('selected');
else if( linkURL==requestURL ) parent.addClass('selected');
});

//date-nav
if( typeof(ccmDateNav)!='undefined' && ccmDateNav ){
//ccmDateNav.setPg( data.cID, data.dateKey );
$('.ccmDateNav a').each(function(i,el){
var linkURL = el.href.replace(/index.php\//i,'');
if( linkURL==requestURL ){
$(el.parentNode).addClass('selected');
ccmDateNav.triggered( $(el.parentNode.parentNode.parentNode).find('.trigger').get(0),'open');
}else $(el.parentNode).removeClass('selected');
});
}

});
freestylemovement replied on at Permalink Reply
freestylemovement
Is this function within the targeted block's (ie auto nav) view.php or do I insert them in rapid paging..?

I could use this method to bind any JavaScript based nav such as dojo page filter too?

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.