Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-17 13:12:43

satsilem
Member
Registered: 2006-09-20
Posts: 19

How to make an online directory

Hello to everybody,

one more time I have to thank all of you who give help to all newcomers.
First of all my apologiew if there is already a post covering the same topic, but I cant really find anything about.

So I would like to create a page for my links where I want to have a list of all my link categories generated by my link categories automatically like this for example:

Art
Museums
Photography
Music
e.t.c

and then when you click at one category then see all the links under this category.

Sounds easy. But I cant find how to do that.

Thanks in advance for your help, and please forgive me for my bad english its not my native language.

Offline

#2 2007-01-17 18:05:55

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to make an online directory

Something like this:

<txp:linklist form="directory" sort="category" />

And in form ‘directory’:

<txp:if_different><h3><txp:link_category title="1" /></h3></txp:if_different>
<txp:link /><br />

I hope you know how to add the toggle effect yourself ;)

Last edited by els (2007-01-17 18:07:12)

Offline

#3 2007-01-17 19:16:32

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

Re: How to make an online directory

>Els

I hope you know how to add the toggle effect yourself ;)

Look over here … Similar discussion in progress.

Last edited by mrdale (2007-01-17 19:16:57)

Offline

#4 2007-01-18 09:39:38

satsilem
Member
Registered: 2006-09-20
Posts: 19

Re: How to make an online directory

Thank you for you help! this works.

What about having the list of link categoriew and then when you click on the category a new page loads with the list of the links of the specific category.

Thank you one more time for your help

Offline

#5 2007-01-18 21:51:38

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to make an online directory

satsilem wrote:

What about having the list of link categoriew

<txp:category_list type="link" />

Use the categories attribute to specify and order the categories, and section to specify the section/page where the list of links has to be displayed.

and then when you click on the category a new page loads with the list of the links of the specific category.

In the page template:

<txp:if_category name="art">
<txp:linklist label="Art" category="art" wraptag="ul" break="li" />
</txp:if_category>
<txp:if_category name="museums">
<txp:linklist label="Museums" category="museums" wraptag="ul" break="li" />
</txp:if_category>

Even better: get asy_wondertag and do this

<txp:linklist label="<txp:category title="1" />" category="<txp:category />" wraptag="ul" break="li" />

Last edited by els (2007-01-18 21:56:01)

Offline

#6 2007-01-22 15:45:50

satsilem
Member
Registered: 2006-09-20
Posts: 19

Re: How to make an online directory

Thanks it works!

Offline

#7 2008-06-15 07:02:45

keukenkikker
Member
From: Netherlands
Registered: 2006-08-08
Posts: 79
Website

Re: How to make an online directory

I’m looking for the same solution, but part 2 is not working for me. The link overview sorted on category is working fine. I’m also able to create a page with only the categories.
However, then something goes wrong.

I’ve created a section called portals and I’ve created a page called portals.
I’ve copied the following in the page:

<txp:if_category name=“portals”>
<txp:linklist label=“Portals” category=“portals” wraptag=“ul” break=“li” />
</txp:if_category>
<txp:if_category name=“museums”>
<txp:linklist label=“Museums” category=“museums” wraptag=“ul” break=“li” />
</txp:if_category>

When I go directly to http://www.mydomain.com/portals the page remains empty.

When I want to click on the category ‘portals’, TP is looking for a link http://www.mydomain.com\categorie\portals.

Can you please explain me what I’m doing wrong?
Thanks in advance!

Offline

#8 2008-06-15 13:24:04

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to make an online directory

Hi Sharon, you are probably confusing sections and categories. domain.com/portals/ is your page for section ‘portals’. domain.com/categorie/portals is the page for category ‘portals’. This category page uses the front page (and – probably – page template ‘default’), while your code is in the page template for section ‘portals’. So you can either

  1. move the code from page ‘portals’ to page ‘default’ (this makes your category display on domain.com/categorie/portals), or
  2. change <txp:category_list type="link" /> into <txp:category_list type="link" section="portals" />, which will take you to domain.com/portals/?c=portals

Offline

#9 2008-06-15 20:52:45

keukenkikker
Member
From: Netherlands
Registered: 2006-08-08
Posts: 79
Website

Re: How to make an online directory

I’ve created the following:

3 link categories:
organisations, portals and partners

page: link_directory
<txp:linklist form=“link_directory” sort=“category,linkname” />

form: link_directory
<txp:if_different><txp:link_category title=“1” /></txp:if_different>
<txp:link /><br />

section: links (using page link_directory)

When I go to mydomain.com/links the following is shown:

Organisations Amnesty Unicef Warchild

Partners etc.

You probably understood this already, but it helps me to get things clear :-)

NEXT:
I’ve changed the page: link_directory into
<txp:category_list type=“link” />

I’ve removed the content of form: link_directory.

When I go to mydomain.com/links the following is shown:
Organisations (link to mydomain.com/categorie/organisations)
Partners (link to mydomain.com/categorie/partners)
Portals (link to mydomain.com/categorie/portals)

… and this is where I get stuck. I cannot seem to find any way to show the links from a category
on any page …

I’ve tried to put in some code in the form: link_directory but that doesn’t matter anyway, because
I cannot seem to get there :-(.

I’ve also tried to change the page: link_directory into <txp:category_list type=“link” section=“link_directory” form=“links”/>
and I see the difference you explained in your last post … but I don’t know how to continue.

By the way, I think the last method is preferable, because the links should not be one the default
page, but on a seperate page.

Do you have some more advice for me?

Offline

#10 2008-06-15 22:41:50

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: How to make an online directory

I think what you need is something like this (first install and activate asy_wondertag):

This goes on your page ‘link_directory’:

<txp:if_category>
   <h3><txp:category type="link" title="1" /></h3>
      <txp:asy_wondertag>
         <txp:linklist category="<txp:category />" form="link_directory" wraptag="ul" break="li" />
      </txp:asy_wondertag>
   <p><txp:section name="links" link="1">Back to link directory</txp:section></p>
<txp:else />
   <txp:category_list type="link" section="links" wraptag="ul" break="li" />
</txp:if_category>

Form ‘link_directory’ could be like this:

<txp:link />

Offline

#11 2008-06-16 13:20:43

keukenkikker
Member
From: Netherlands
Registered: 2006-08-08
Posts: 79
Website

Re: How to make an online directory

Els, I think you’re absolutely right!

Thank you!
Sharon

Offline

Board footer

Powered by FluxBB