Posts: 218
Threads: 59
Joined: May 2013
I read that it is possibe to create a sitemap with I18N but i can not
find informations what i must do to get a sitemap to implement it into
a sampe page or into the template.
Anyone can help?
Posts: 423
Threads: 15
Joined: Mar 2011
(2013-10-13, 08:01:17)phpman Wrote: I read that it is possibe to create a sitemap with I18N but i can not
find informations what i must do to get a sitemap to implement it into
a sampe page or into the template.
My method (not original, but I don't remember where it came from) to put a Sitemap on a page:
Component 'sitemap':
PHP Code:
<?php
echo '<div id="sitemap"><ul>';
get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_PAGES);
echo '</ul></div>';
?>
On the page:
Depends on plugins: I18N Search, DynPages.
I use CSS on the Sitemap page to hide the Sitemap and the custom 404 page in the list.
--
Nick.
Posts: 218
Threads: 59
Joined: May 2013
2013-10-13, 18:45:34
(This post was last modified: 2013-10-13, 18:46:55 by phpman.)
hmm... i´ve test this but it dosn´t work if i create a component like this.
Problem i think is that the component normaly shown by the following tag only:
Code:
<?php get_component('sitemap'); ?>
and i can´t use {sitemap} as a slug in the content pages.
Did you have reference site who i can shown the result of your work?
Posts: 423
Threads: 15
Joined: Mar 2011
(2013-10-13, 18:45:34)phpman Wrote: ... and i can´t use {sitemap} as a slug in the content pages.
Read what I said:
Quote:Depends on plugins: I18N Search, DynPages.
DynPages is necessary to call a component directly from the page editor.
Or, you put directly in the template:
PHP Code:
<div class="sitemap"><ul>
get_i18n_navigation(return_page_slug(),0,99,I18N_SHOW_PAGES);
</ul></div>
You must wrap the PHP in <ul> ... </ul>. The <div class="sitemap"> ... </div> is convenient for styling, but not essential.
--
Nick.