loading ajax! :), problem with {} tags :(
loading ajax! :), problem with {} tags :(
I load content using ajax, but I have problems with modules, like gallery because {gallery} is just loaded like text (of course), but ¿how can it work? ¿How can it proccess in the request? I don't know how.
Re: loading ajax! :), problem with {} tags :(
How exactly you did that ?I load content using ajax
Re: loading ajax! :), problem with {} tags :(
with jquery. I make the request to the DB through a php file that is not of the core of the cms. So I need to know what variables or file I must to include in the process file to execute the {} tags.
It´s like this:
and the menu
Home
I load the content, but I need to know what vaiables or files include in ifes.php to process the modules.
It´s like this:
Code: Select all
<__script__ type="text/javascript" language="javascript" src="uploads/js/jquery.js"></__script>
<__script__ language="javascript">
function Cargo(){
$("#links a").click(function(){
UpdateDiv(this.href);
return false;
});
}
function UpdateDiv(Url){
$.ajax({
type: 'get',
url: Url,
dataType: 'html',
success: function(data){
$("#data").html(data)
}
});
}
$(document).ready(Cargo);
</__script>
Home
I load the content, but I need to know what vaiables or files include in ifes.php to process the modules.
Re: loading ajax! :), problem with {} tags :(
If url is appended with "showtemplate=false" CMSMS returns processed content only. Additionally you can specify required div (it could be #data in your case). There should also exist parent div of #data div only.
/* */
Re: loading ajax! :), problem with {} tags :(
I'm sorry but I'm not an expert in javascript. ¿I need replace my code with your code or use both or mix? Becouse if I only use your code it send me to ifes.php but don't load dinamicly.
and also "showtemplate=false" ¿must be added in the link with the menu manager?
and also "showtemplate=false" ¿must be added in the link with the menu manager?
Re: loading ajax! :), problem with {} tags :(
Well there is a misunderstanding.
ifes.php does not belong to CMSms.
So "showtemplate=false" doesn't do anything.
What Peciura meant was to use only CMSms stuff to load the content.
(no external script like ifes.php <- what does this do anyway?)
That means you should use the link of the MenuManager to load the content. (what will link to index.php?page=home)
If you append "showtemplate=false" to the url that is created by the MenuManager it will load the processed content only (without the layout stuff).
So use a default CMSms menu and Peciuras script.
ifes.php does not belong to CMSms.
So "showtemplate=false" doesn't do anything.
What Peciura meant was to use only CMSms stuff to load the content.
(no external script like ifes.php <- what does this do anyway?)
That means you should use the link of the MenuManager to load the content. (what will link to index.php?page=home)
If you append "showtemplate=false" to the url that is created by the MenuManager it will load the processed content only (without the layout stuff).
So use a default CMSms menu and Peciuras script.
Re: loading ajax! :), problem with {} tags :(
Many thanks ; Peciura and Nan it work fine and load the content of the {gallery}. But don't load the javascript and the css associated
it's necessary make a different script to load that? or I just miss something?
it's necessary make a different script to load that? or I just miss something?
Re: loading ajax! :), problem with {} tags :(
Gallery module inserts the javascript and the css in the head section of your template.
Since there is no template processed it cannot do that.
Try to paste the js and the css in the main Gallery template.
Something like this:
So js and css belongs to the Gallery content.
Since there is no template processed it cannot do that.
Try to paste the js and the css in the main Gallery template.
Something like this:
Code: Select all
{literal}
<style type="text/css">
...
</style>
<__script__ language="JavaScript" type="text/javascript" src="...">
<__script__ language="JavaScript" type="text/javascript">
...
</__script>
{/literal}
{Gallery smarty stuff here}
Re: loading ajax! :), problem with {} tags :(
Well, I try with the change in the gallery but now I have this error "jQuery("#links a").live is not a function" and don't work. I set all like I have before and nothing
Re: loading ajax! :), problem with {} tags :(
You could always include required JavaScripts and CSS to your template (check if Gallery can skip this action).
Link to your site would be very handy... I would like to see what tells you "jQuery("#links a").live is not a function"
Link to your site would be very handy... I would like to see what tells you "jQuery("#links a").live is not a function"
Re: loading ajax! :), problem with {} tags :(
Many thanks paciura, I use my functions again and all work fine. the links is www.octoporos.com/templates and the template where I use ajax is Testing (select it from dropdown list if it's not there)
Last edited by Ruben_c on Thu Nov 11, 2010 2:00 am, edited 1 time in total.
Re: loading ajax! :), problem with {} tags :(
Would you create another template for jQuery (mod of "Testing") ? Also put to new so it had parent div (not body). Menu urls should be appended with &showtemplate=false by JavaScript. This way they will be 100% working without JavaScript only.
/* */
Last edited by Peciura on Thu Nov 11, 2010 9:52 pm, edited 1 time in total.
Re: loading ajax! :), problem with {} tags :(
Thanks again paciura, I'll take your advise to do another template.
Meanwhile I made another adaptation called minimal_ajax. if you want see it from dropdown and click switch.
Meanwhile I made another adaptation called minimal_ajax. if you want see it from dropdown and click switch.