Page 1 of 1
[SOLVED]create web page which sums the sitemap of many sites
Posted: Tue Sep 09, 2014 5:22 pm
by giapippo
hello
I would like to create a web page like this
http://www.cmsmadesimple.org/about-link/sitemap/
I should import the sitemap.xml from other sites in order to create a summary page of all websites
you think it is possible?
thanks
Re: create web page which sums the sitemap of many sites
Posted: Tue Sep 09, 2014 7:49 pm
by Dr.CSS
That is basically a menu tag that outputs an UL/LI with out any styling etc...
Re: create web page which sums the sitemap of many sites
Posted: Tue Sep 09, 2014 9:32 pm
by giapippo
hello
but I would like to create a page that contains the sitemap from more websites
I would like to do an experiment of link building
Re: create web page which sums the sitemap of many sites
Posted: Wed Sep 10, 2014 4:47 am
by Rolf
Re: create web page which sums the sitemap of many sites
Posted: Wed Sep 10, 2014 10:09 am
by faglork
Should be super-easy with the XMLmadeSimple module ...
Cheers,
Alex
Re: create web page which sums the sitemap of many sites
Posted: Wed Sep 10, 2014 8:11 pm
by giapippo
thanks
XMLMadeSimple is interesting but I do not understand how to get what I want with the template
how can I make a sitemap with these parameters as this
-------------------------------------------------------------
SimpleXMLElement Object
(
=> Array
(
[0] => ... todire.it/
http://autodire.it/chi-siamo
Re: create web page which sums the sitemap of many sites
Posted: Thu Sep 11, 2014 11:28 am
by faglork
Look at the xml file. You will see what the items are called.
Lets assume they are called "entry", so that your xml item should look like this:
<entry>
<loc>someurl.it</loc>
<lastmod>somedate</lastmod>
...
...
</entry>
In your template you would use (really simplified example):
{foreach from=$xml->entry item=entry}
<p><a href="{entry->loc}">{entry->loc}</a></p>
{/foreach}
hth,
Alex
Re: create web page which sums the sitemap of many sites
Posted: Thu Sep 11, 2014 8:12 pm
by giapippo
thanks for replay
I found this code that works
{if $xml}
<p><a href="{$xml->url->loc}">{$xml->url->loc}</a></p>
{/if}
this result
http://www.gianlucacompagno.com/link
but can only read the first block of the file
how can I make it go forward?
thanks for help
Re: create web page which sums the sitemap of many sites
Posted: Fri Sep 12, 2014 3:29 pm
by faglork
giapippo wrote:thanks for replay
I found this code that works
{if $xml}
<p><a href="{$xml->url->loc}">{$xml->url->loc}</a></p>
{/if}
this result
http://www.gianlucacompagno.com/link
but can only read the first block of the file
how can I make it go forward?
Just look at the code I posted
This is called a "loop": the FOREACH statement iterates through all the elements of the XML list:
- for each element {foreach ...}
- from this list of elements (from $xml->url)
- which we will call *somename* (item=url) in this loop
- do this: get the needed element data (url->loc) and show them including some html code
- end of loop {/foreach}
So:
{foreach from=$xml->url item=url}
<p><a href="{url->loc}">{url->loc}</a></p>
{/foreach}
should work ...
Ciao,
Alex
Re: create web page which sums the sitemap of many sites
Posted: Fri Sep 12, 2014 4:36 pm
by giapippo
hallo thank for replay
the correct script is this
----------------------------------------------------------------
{foreach from=$xml->url item='url'}
<li><a href="{$url->loc}">Link: {$url->loc}</a></li>
{/foreach}
----------------------------------------------------------------
Now the last step
I would like the template would use the sitemap link to retrieve the "title" of the corresponding page
thanks for help
Re: create web page which sums the sitemap of many sites
Posted: Fri Sep 12, 2014 4:53 pm
by faglork
just look how the title entry is called in the xml file ... then proceed as above.
hth,
Alex