[SOLVED]create web page which sums the sitemap of many sites

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

[SOLVED]create web page which sums the sitemap of many sites

Post 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
Last edited by giapippo on Thu Sep 25, 2014 3:28 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: create web page which sums the sitemap of many sites

Post by Dr.CSS »

That is basically a menu tag that outputs an UL/LI with out any styling etc...
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: create web page which sums the sitemap of many sites

Post 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
User avatar
Rolf
Power Poster
Power Poster
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Contact:

Re: create web page which sums the sitemap of many sites

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
faglork

Re: create web page which sums the sitemap of many sites

Post by faglork »

Should be super-easy with the XMLmadeSimple module ...

Cheers,
Alex
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: create web page which sums the sitemap of many sites

Post 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
faglork

Re: create web page which sums the sitemap of many sites

Post 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
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: create web page which sums the sitemap of many sites

Post 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
faglork

Re: create web page which sums the sitemap of many sites

Post 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
giapippo
Forum Members
Forum Members
Posts: 176
Joined: Tue Feb 28, 2012 1:24 pm

Re: create web page which sums the sitemap of many sites

Post 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
faglork

Re: create web page which sums the sitemap of many sites

Post by faglork »

just look how the title entry is called in the xml file ... then proceed as above.

hth,
Alex
Post Reply

Return to “Modules/Add-Ons”