Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-06-15 23:07:37

SEF
New Member
Registered: 2007-05-28
Posts: 6

showing only certain Categories for certain sections

Apologies if this is either an easy thing to do, or covered in other posts – I’ve spent the last hour or more looking for an answer but couldn’t find anything.

I have a client site to produce with quite a few different pages.

The will be split into three main sections – Gallery, News, Case Studies. Within each main section there will be subsections, so Gallery with have a page for product 1, product 2 & product 3. News will have two pages – What’s on & Press releases, and Case Studies will have around 4 pages, each one a different client project.

The navigation I’d like to use will be horizontal, top line showing main sections, beneath that depending on which section you are in you will see the sub section selection.

I’ve just started fleshing out the site in textpattern, I can get the main section menu working with the section list tag, but how would it be best to create the sub sections? Should I use Categories for these and if so how do I make sure only the relevant Categories are in the menu for the relevant page?

I’m looking forward to getting the Textpattern book, but my order with Amazon is stating 1 – 2 weeks delivery, so if anyone can offer a suggestion to get me going before the book arrives (and hopefully has the answer to this in it!) I’d really appreciate it.

SEF

Offline

#2 2007-06-16 07:28:31

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,731
Website

Re: showing only certain Categories for certain sections

From your description it sounds like the sub-items are not really sections but pages. If that is so, you can simply use an article per sub-item and then generate the menu as a list of the article titles, for instance using txp:article_custom (if you want the menu to appear when viewing an individual article) or one of the many similar plug-ins (see textpattern resources).

If you end up later with lots of case studies, you could use categories to sort or filter them by type e.g. for a portfolio site, you would add categories for graphics, print, web, etc. for use in your case studies section.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2007-06-16 08:53:41

SEF
New Member
Registered: 2007-05-28
Posts: 6

Re: showing only certain Categories for certain sections

HI

Thanks very much for your reply.

On some if the pages that are going to be made using Articles there will be elements relating to other parts of that section, sort of like cross site advertising. So in the section called Gallery an individual page (Article) would be Widget 1, on that page I’d like to enter something relating to the development of Widget 2 and information of how Company A have used Widget 1 – this would be an excerpt from a page (Article) from the Case studies section.

Can I do that if the page is generated as an Article?

Thanks again for your help.

SEF

Offline

#4 2007-06-16 14:09:36

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,731
Website

Re: showing only certain Categories for certain sections

I’m not sure I follow (development of widget 2 described in article on widget 1?), but I imagine you mean providing links to a related article or articles that are stored in another section. You have several options:
  • You could assign each of the articles to a common but otherwise unique category (basically establishing a relationship between them) and then use txp:related_articles. This is probably easiest but isn’t quite how categories were conceived.
  • you could hardlink the articles to one another using textile in the body of the article, i.e. "more on how widget 1 has been used by company A":/case-studies/article-url-name-for-widget-1-in-use or better still use txp:permlink with the id="{id# of target article}" attribute.
  • use a custom field to enter the article ID# of the ‘related article’ and either use txp:permlink as described above to make a link or use article-custom together with the id="" attribute to pull out the excerpt from the related article. This may need some trickery to get it right (you’ll need to insert the value from your txp:custom_field inside txp:article_custom or txp:permlink, which doesn’t work out of the box as it involves nesting txp tags. It should work with the help of sencer’s asy_wondertag plug-in or written in php as per this thread).

hope that helps

Last edited by jakob (2007-06-16 14:12:07)


TXP Builders – finely-crafted code, design and txp

Offline

#5 2007-06-16 15:48:01

SEF
New Member
Registered: 2007-05-28
Posts: 6

Re: showing only certain Categories for certain sections

Hi Jakob

I didn’t do a very good job of explaining that did i?

What I tried to say was that I’d like to have excerpts or small one paragraph articles that relate to the main article that will be creating the page. These small paragraphs may or may not link through into other pages.

I know I can create a page for one article, but I’m not sure how I add other articles on there that relate to it.

Thanks!

SEF

Offline

#6 2007-06-16 17:01:25

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: showing only certain Categories for certain sections

SEF wrote:

I know I can create a page for one article, but I’m not sure how I add other articles on there that relate to it.

<txp:related_articles />


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#7 2007-07-05 20:37:20

Charlie Chalk
Member
Registered: 2005-09-06
Posts: 51

Re: showing only certain Categories for certain sections

Hi

I have articles listed on my pages relating to the main article using the related_Articles tag. The problem I’d like to solve is how I can show the body text of the related articles rather than just the title (as a link). I don’t need the link as this is the only way these articles will be seen, as sub articles of the main one.

Is there a tag (or plugin) that will show title & body text for an article related to the main article?

CC

CC

Offline

#8 2007-07-05 21:21:54

Charlie Chalk
Member
Registered: 2005-09-06
Posts: 51

Re: showing only certain Categories for certain sections

Sorry all – I should have searched a little harder before asking here – a little more time on google returned the following plugin:
chh_related_articles
It does exactly what I need it to do.
CC

Offline

#9 2007-08-15 22:15:39

Charlie Chalk
Member
Registered: 2005-09-06
Posts: 51

Re: showing only certain Categories for certain sections

Hi All

I’ve almost finished the site I asked the above question about, and thought I’d got over the problems I was having with the <txp:chh_related_articles> plugin.

I just enabled testing mode on my 4.05 install as a page was taking too long to load and I found a stack of error messages from the above plugin.

After a little more digging I’ve found I’m not the only one suffering from this problem and support for the plugin seems to have stopped.

Can anyone suggest another way of linking two articles together so when I create a webpage from a single article the associated article is displayed on the page as well?

Example: I have a section called ‘products’ with a sticky article creating the content. I then have another page created from a article in the ‘products’ section called ‘plastic widget one’ what I am currently doing with the <txp:chh_related_articles> plugin is displaying a second article on the ‘Plastic widget one’ page that is associated with it through a custom field.

Does that make sense?

I’d really like to find a way round this, the site is working but the pages that use this plugin are very slow.

Thanks

CC

Offline

Board footer

Powered by FluxBB