Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-12-13 16:01:40
- vickilh
- Member
- Registered: 2007-10-30
- Posts: 96
Texpattern sitemap?
Based on what I read in an earlier post, I’ve done this so far:
——————-
1. Created a form called Sitemap:
<li><txp:permlink><txp:title /></txp:permlink> (<txp:section />)</li>
2. Created a new template called Sitemap, which I added this:
<ul><txp:article_custom limit=99999 form=“sitemap” sortdir=“asc” sortby=“section” /></ul>
—————————-
But … (I’m new to Texpattern) .. how do I get the sitemap to display?
I’ve set up the form, template, and corresponding section. If I go to the URL for that section [<site>/txp/?s=Sitemap], nothing shows up. — I know I’m missing something, just don’t know what.
Thanks!! Vicki
Offline
Re: Texpattern sitemap?
This post offers a step by step method or if you want your articles to be organised by categories you may want to check stuarts’s site
Last edited by colak (2007-12-13 16:11:09)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
#3 2007-12-13 20:38:16
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Texpattern sitemap?
Vicki, probably a silly question, but did you also create a section ‘sitemap’ to which you assigned page template ‘sitemap’? And if you did, make sure that the section name is all lowercase. So your URL would be ?s=sitemap
, not ?s=Sitemap
.
Doesn’t it display anything at all?
Another cause of the problem could be, if you copied that code from somewhere, that the quotes got textiled. Try this:
<txp:article_custom limit="9999" form="sitemap" sort="section asc" />
Offline
#4 2007-12-13 20:59:05
- vickilh
- Member
- Registered: 2007-10-30
- Posts: 96
Re: Texpattern sitemap?
You were right- YAY! My copied piece of code must have gotten textiled! I was getting nothing before, and now I get a list of all my categories, grouped by Section.
(probably another dumb question, but I haven’t figured this out yet & I’ve spent so much time on this now ..) Can I have it head up each section with the Section name link, followed by all the categories in that section?
THANK YOU!! vicki
Offline
#5 2007-12-13 21:18:38
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Texpattern sitemap?
Yes, you can use txp:if_different to do that:
On the page:
<ul><txp:article_custom limit="9999" form="sitemap" sort="section asc" /></ul>
Your form:
<txp:if_different></ul>
<h3><txp:section link="1" title="1" /></h3>
<ul></txp:if_different>
<li><txp:permlink><txp:title /></txp:permlink></li>
Note that you will get an empty set of <ul></ul>
tags at the beginning of your list. To my knowledge so far there is no solution for that. You could give the first ul a style="display:none;"
to prevent it from messing up your layout.
Offline
#6 2007-12-13 21:38:36
- vickilh
- Member
- Registered: 2007-10-30
- Posts: 96
Re: Texpattern sitemap?
Wonderful! You’ve made my day. I had gotten so tired of looking at this.
I have just one piece to go now. How do I sort the categories (within the sections) alphabetically? I’ve tried different things, no go yet.
THANKS again! Vicki
Offline
#7 2007-12-13 21:47:27
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Texpattern sitemap?
<txp:article_custom limit="9999" form="sitemap" sort="section asc, title asc" />
Offline
#8 2007-12-13 22:04:45
- vickilh
- Member
- Registered: 2007-10-30
- Posts: 96
Re: Texpattern sitemap?
PERFECT. You’ve saved me days of hair-pulling! Can’t thank you enough!! Vicki
Offline
#9 2007-12-13 22:07:33
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Texpattern sitemap?
Glad it helped :)
Offline
#10 2007-12-28 17:05:19
- vickilh
- Member
- Registered: 2007-10-30
- Posts: 96
Re: Texpattern sitemap?
Hello again!
My sitemap is working fine with this code, but ….
Is there some way I can list out my sitemap so that within the sections, category children are indented below the category parent? I.e., instead of: ————————————- SECTION- category-parent
- category-child
- category-child
- category-child
- category-child
- category-parent
— It would be listed out like this:
SECTION- category-parent
- category-child
- category-child
- category-child
- category-child
- category-parent
—————————————————-
Thanks! Vicki
Last edited by vickilh (2007-12-28 22:12:12)
Offline
Pages: 1