Using the XML nodes
Using the XML nodes
Hello, a lot of the post that I have on here that live here I think come down this one question... what is the best way to the XML of lets all the job postings so one may use it in flash... Calguy had a though on one of the unsolved topics I started
http://forum.cmsmadesimple.org/index.php/topic,19859.msg97728.html#msg97728
now that seems to be a start but my questions ... Can i do this action for anything, Job listings, calendar ect... How can all the queries be reduced to speed up the response? it took of ever to get the information this way, though it worked for the most part. Could one write a php file with the smarties in it, is that a bad idea?
The major draw back that I see going the way that Calguy suggested is that I’d have to have multiple "XML" pages for each type of information or deal with a long wait time for the phrased information...
Any ideas would be great, I have a lot of fun easy apps the make web site mangment that I’d love to share here but they all need a XML connectors to work like they do on my other sites were they connect to a php script that access the data base and does all the foot work... Thanks
http://forum.cmsmadesimple.org/index.php/topic,19859.msg97728.html#msg97728
now that seems to be a start but my questions ... Can i do this action for anything, Job listings, calendar ect... How can all the queries be reduced to speed up the response? it took of ever to get the information this way, though it worked for the most part. Could one write a php file with the smarties in it, is that a bad idea?
The major draw back that I see going the way that Calguy suggested is that I’d have to have multiple "XML" pages for each type of information or deal with a long wait time for the phrased information...
Any ideas would be great, I have a lot of fun easy apps the make web site mangment that I’d love to share here but they all need a XML connectors to work like they do on my other sites were they connect to a php script that access the data base and does all the foot work... Thanks
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Using the XML nodes
it's also possible to request just the output from a single module action, and therefore you could use a template that generated xml and call just the one module.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Using the XML nodes
Will this fix the queries issues?
from the try at something like this before the output I get is
Also could I have this all on one page? I'd think that a robust {if}could handle targeting the one module of many on that content page, but I’d fear that would slow it all down... right? I'd hate to have 30 XML pages for each one but also don't want 30 queries also...
side though on this... how could one write back to the data base thought this method? Is that possible? Thanks Calguy for you timely responses... love this app...
from the try at something like this before the output I get is
but this didn't make the query request for the logged in user as no one is logged in... so there would be a few more for that... 6 seems high...
Also could I have this all on one page? I'd think that a robust {if}could handle targeting the one module of many on that content page, but I’d fear that would slow it all down... right? I'd hate to have 30 XML pages for each one but also don't want 30 queries also...
side though on this... how could one write back to the data base thought this method? Is that possible? Thanks Calguy for you timely responses... love this app...
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Using the XML nodes
try a url like http://mysite.com/index.php?mact=News,c ... eturnid=39
that calls a module action directly and doesn't involve any page template
that calls a module action directly and doesn't involve any page template
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Using the XML nodes


So then would this work for say a user logged in? I'm assuming that but i have pretty URLs on and i forgot what the stuff after was... side though on this... would I be able to write back data to the db thought this method? Is that possible?
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Using the XML nodes
yeah, that can be used to generate xml you just need to style up a template for that output
for example you could use it with menumanager to dump out an xml menu
Telling if a user is logged in or not.... well that gets tricky, but you could say use the News module and yet another template that output the feu logged in details.
as far as writing back to the database, you probably could, but you would need intimate knowledge of the code and you'd have to simulate the data from the various form fields.
for example you could use it with menumanager to dump out an xml menu
Telling if a user is logged in or not.... well that gets tricky, but you could say use the News module and yet another template that output the feu logged in details.
as far as writing back to the database, you probably could, but you would need intimate knowledge of the code and you'd have to simulate the data from the various form fields.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Using the XML nodes
So I have this clear... Lets say I want to get the listing of the jobs out of the Jobs module... If i from flash wrote the url asyeah, that can be used to generate xml you just need to style up a template for that output
for example you could use it with menumanager to dump out an xml menu
http://mysite.com/index.php?mact=Jobs,__not__sure___after___this
I would not get XML back, I would have to run it throug a page like we talked about on http://forum.cmsmadesimple.org/index.php/topic,19859.msg97728.html#msg97728

sorry i'm trying to wrap my mind on this lol... but since this seems like the core question to all my older post i'll have to warp harder

-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Using the XML nodes
I don't know the jobs module.... but lets just say you wanted to put the news data into xml for pulling into flash here are the steps you would take:
1) write a news detail template the output the xml
2) Call flash with a url similar to the one I described above, but with a couple of other parameters.... detailtemplate=myxmltemplate for example
3) you may have to modify the index.php file to NOT output the 'generated by CMS Made simple....' stuff, but that's just deleting two lines
then, bob's your uncle.
For things like 'logged in user name' I would cheat and use another News template, that generated some xml about the currently logged in user (customcontent can be used in the template to get the information out).
Then the url would change (the detailtemplate would be different)), but it would work.
1) write a news detail template the output the xml
2) Call flash with a url similar to the one I described above, but with a couple of other parameters.... detailtemplate=myxmltemplate for example
3) you may have to modify the index.php file to NOT output the 'generated by CMS Made simple....' stuff, but that's just deleting two lines
then, bob's your uncle.
For things like 'logged in user name' I would cheat and use another News template, that generated some xml about the currently logged in user (customcontent can be used in the template to get the information out).
Then the url would change (the detailtemplate would be different)), but it would work.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Using the XML nodes
Ok so, I think I got what you are saying now about using the news temple to bypass the "page-content-template" issue as we discussed on the older post and in this one...
So with you though on 'logged in user name' type things, I should be able to may-be more broadly use the templates in the news area to address the jobs listing by pulling the listing through the new module?
I bring up the jobs again as it does not have add template abilities, and the post from before that I refer to also does not have a add template abilities to work with... Many of the ideas I have come to this point: The idea is that I'd like to be able to pull the data in XML format from any module... may-be be a global way to do this?
So with you though on 'logged in user name' type things, I should be able to may-be more broadly use the templates in the news area to address the jobs listing by pulling the listing through the new module?
I bring up the jobs again as it does not have add template abilities, and the post from before that I refer to also does not have a add template abilities to work with... Many of the ideas I have come to this point: The idea is that I'd like to be able to pull the data in XML format from any module... may-be be a global way to do this?
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
Re: Using the XML nodes
No, there's no 'global' way to do that.... but you could probably pull jobs data out of the jobs module and display it using News.
you'd have to do something like:
a) copy the jobs template into the clipboard
b) paste it into a new news template
c) add {capture assign='junk'}{jobs ....}{/capture} at the top of the template
d) hack the template to output the jobs data in xml
e) use a url similar to the ones I've already provided to generate the xml
it does add extra queries though, as it's a 'hack'.... this method would result in the jobs queries (however many that are required), and at least one query from the news module.... there's no way around that.
Unfortunately, there's no easy way to get CMS to output pure XML code in pages, similarly there's no way to just call a UDT or a GCB. it can come close but there'll always be some header information, and the footer stuff that gets added to the output. The hack is to call a module action and tell it to use a different template, and the News module is the most common module that people use, it supports multiple templates easily, and just 'works'.
you'd have to do something like:
a) copy the jobs template into the clipboard
b) paste it into a new news template
c) add {capture assign='junk'}{jobs ....}{/capture} at the top of the template
d) hack the template to output the jobs data in xml
e) use a url similar to the ones I've already provided to generate the xml
it does add extra queries though, as it's a 'hack'.... this method would result in the jobs queries (however many that are required), and at least one query from the news module.... there's no way around that.
Unfortunately, there's no easy way to get CMS to output pure XML code in pages, similarly there's no way to just call a UDT or a GCB. it can come close but there'll always be some header information, and the footer stuff that gets added to the output. The hack is to call a module action and tell it to use a different template, and the News module is the most common module that people use, it supports multiple templates easily, and just 'works'.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: Using the XML nodes
Well I’ll give it a go... thanks for the clarification…
So could a Globe XML module be possible to create? I think that would be the key for some really cool things… I do a lot of stuff in flash and Flex and it’d be nice to have a XML pipe from any part of a site to connect to… I’d say I’d create it but I’m not a great coder… I know flash, some javascript, thml stuff but only enough php to get by…
May-be something like:
Pick module(news) ---> pick data(user name) ----> choose output(XML) --- > gives url to link to
may-be 
Would that work?
So could a Globe XML module be possible to create? I think that would be the key for some really cool things… I do a lot of stuff in flash and Flex and it’d be nice to have a XML pipe from any part of a site to connect to… I’d say I’d create it but I’m not a great coder… I know flash, some javascript, thml stuff but only enough php to get by…
May-be something like:
Pick module(news) ---> pick data(user name) ----> choose output(XML) --- > gives url to link to


Would that work?
Re: Using the XML nodes
Hello, So I'm beating this path down and I think i'm getting some where...
https://corbensproducts.com/Resale/WebSales/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=1&cntnt01showtemplate=JobsXMLoutput&cntnt01returnid=1 doesn't work... if I type it in I got a 404
so i tested it out by placing the
{cms_module module='Jobs' summarytemplate="JobXML.tpl"}
in a test page and got out
The job JobXML.tpl looks like this
so i kinda got the right stuff out
so what i did to start with in the news area is like this:
1.) added a template JobsXMLoutput in the News Detail Template area with
2.)call the url in IE to view out put which i don't think i have the url writen right... as it seems to me that it's trying to call an artical...
SO....
I try this route:
1.)changed template JobsXMLoutput in the News Detail Template area to
2.)changed the first news item, (the CMS Installed one) which i thought would be artical 1 in cat 1, to:
Title:1
Category: General
Summary:"" ****empty****
Content:{cms_module module='Jobs' summarytemplate="JobXML.tpl"}
3.)call the url in IE to view out put which i don't think i have the url writen right cause i get a 404
an ideas... it seems to me i'm close... i'm don't have the url right...right?
i'm afride my deadline is way to close and any help would be great... thank you
https://corbensproducts.com/Resale/WebSales/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=1&cntnt01showtemplate=JobsXMLoutput&cntnt01returnid=1 doesn't work... if I type it in I got a 404
so i tested it out by placing the
{cms_module module='Jobs' summarytemplate="JobXML.tpl"}
in a test page and got out
Code: Select all
<jobs>
<Job cat="" title=" " summary="string(43) "Smarty error: eval: missing 'var' parameter""/>
</jobs>
Code: Select all
<jobs>
{if $departments}
{foreach from=$departments item=department item=job}
<Job cat="{$department->department}" title="{$job->titlelink} {if $job->hrid}({$job->hrid}){/if}" summary="{eval var=$job->content}"/>
{/foreach}
{/if}
</jobs>
so what i did to start with in the news area is like this:
1.) added a template JobsXMLoutput in the News Detail Template area with
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
{content wysywig='false'}
{cms_module module='Jobs' summarytemplate="JobXML.tpl"}
SO....
I try this route:
1.)changed template JobsXMLoutput in the News Detail Template area to
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
{content wysywig='false'}
Title:1
Category: General
Summary:"" ****empty****
Content:{cms_module module='Jobs' summarytemplate="JobXML.tpl"}
3.)call the url in IE to view out put which i don't think i have the url writen right cause i get a 404
an ideas... it seems to me i'm close... i'm don't have the url right...right?
i'm afride my deadline is way to close and any help would be great... thank you
Re: Using the XML nodes
other note:
tryed
for the news detalis templat as i was not fully sure i followed calguys idea to it's fullest
and allso try https://corbensproducts.com/Resale/WebSales/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=1&cntnt01origid=15&cntnt01returnid=39
and i did that for both of different tamplates
Any help would be great on this... thank you again
tryed
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" standalone="yes" ?>
{content wysywig='false'}{capture assign='junk'}{cms_module module='Jobs'}
<results_packet>
{if $departments}
{foreach from=$departments item=department item=job}
<rec cat="{$department->department}" title="{$job->titlelink} {if $job->hrid}({$job->hrid}){/if}" summary="{eval var=$job->content}"/>
{/foreach}
{/if}
</results_packet>{/capture}
and allso try https://corbensproducts.com/Resale/WebSales/index.php?mact=News,cntnt01,detail,0&cntnt01articleid=1&cntnt01origid=15&cntnt01returnid=39
and i did that for both of different tamplates
Any help would be great on this... thank you again
Re: Using the XML nodes
Ok so runing it through a page i got the xml to out put mostly
This:
Gets Me: (***minus the page tamplate****)
no sure why the summary is not making it... any ideas
The URL works so all is good there
This:
Code: Select all
{capture assign='junk'}{cms_module module='Jobs'}{/capture}
<?xml version="1.0" encoding="utf-8"?>
<!-- Start Jobs List Template -->
<jobs>
{if $departments}
{foreach from=$departments item=department}
{foreach from=$department item=job}
<!-- Start Jobs Display Template -->
<Job cat="{$department[0]->department}" title="{$job->title} {if $job->hrid}({$job->hrid}){/if}" summary="{if $job->summary}{eval var=$job->content}{/if}"/>
{/foreach}
<!-- End Jobs Display Template -->
{/foreach}
</jobs>
{else}
</jobs><Job cat="There are currently no jobs available. Please check in frequently to see when the next position becomes available." title="" summary=""/></jobs>
{/if}
<!-- End Jobs List Template -->
Gets Me: (***minus the page tamplate****)
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!-- Start Jobs List Template -->
<jobs>
<!-- Start Jobs Display Template -->
<Job cat="Human Resources" title="test job one " summary=""/>
<!-- End Jobs Display Template -->
</jobs>
<!-- End Jobs List Template -->
no sure why the summary is not making it... any ideas
The URL works so all is good there
Re: Using the XML nodes
Ok so still having problems... i'm not sure how to set the temple with out showing it
is only works if the defult news templat is set to default:
http://site/index.php?mact=News,cntnt01,detail,4&cntnt01articleid=3&cntnt01showtemplate=false&cntnt01returnid=4
i want to set template=JobsXMLoutput
Ideas???? i think this well finish this whole issue

******eidt***********
ok after alot of poking around...
http://site/index.php?mact=News,cntnt01,detail,4&cntnt01articleid=3&cntnt01showtemplate=false&cntnt01returnid=4&cntnt01detailtemplate=JobsXMLoutput
did the trick... just added &cntnt01detailtemplate=JobsXMLoutput
SOOO all most done with this... I'd say it's close to being soulved just have to do the use side of it and
we are in business
is only works if the defult news templat is set to default:
http://site/index.php?mact=News,cntnt01,detail,4&cntnt01articleid=3&cntnt01showtemplate=false&cntnt01returnid=4
i want to set template=JobsXMLoutput
Ideas???? i think this well finish this whole issue

******eidt***********
ok after alot of poking around...
http://site/index.php?mact=News,cntnt01,detail,4&cntnt01articleid=3&cntnt01showtemplate=false&cntnt01returnid=4&cntnt01detailtemplate=JobsXMLoutput
did the trick... just added &cntnt01detailtemplate=JobsXMLoutput
SOOO all most done with this... I'd say it's close to being soulved just have to do the use side of it and

Last edited by JeremyBASS on Sun Apr 20, 2008 3:47 am, edited 1 time in total.