Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-05-20 18:53:43

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Need help making tagsoup ... ;)

On this site (under contruction!) there is a section ‘Competitie’. There are 7 articles having an individual page, e.g. ‘Gemengd 35+’.

It’s done with:

<txp:if_individual_article>
<txp:article form="singlenolink" limit="1" time="any" />
<txp:output_form form="back" />
</txp:else>
<txp:article limit="1" form="sticky" status="sticky" />
</txp:if_individual_article>

That’s simpel. But now I want to publish some specific articles on each individual page. So on ‘Gemengd 35+’ I want a list of articles (titles!) with content only belonging to ‘Gemengd 35+’. With all having an individual page and also the list of article titles.

It can be done … but how? Please give me a hint what’s the best way to begin making the tagsoup!

Thanks!

Last edited by RedFox (2010-05-20 18:55:44)

Offline

#2 2010-05-20 19:37:00

whaleen
Member
From: Portland
Registered: 2006-05-11
Posts: 373
Website

Re: Need help making tagsoup ... ;)

I think I understand what you are going for.

Can you use the article_custom tag to output the list of article titles you want on the individual articles ‘pages’ (in Gemengd 35+)?

So in addition to what you already have, which works as you say, do you simply need a list of other articles in that section to appear in a menu somewhere on that same page when viewing an individual article?

Using the article_custom tag:

<txp:if_individual_article>
<txp:article_custom form="singlenolink" limit="1" time="any" />
</txp:if_individual_article>

This can be placed on the same page which contains your main article tag. It can live in the same page as your previously posted block of code. The article_custom tag can be used more than once on a page where the article tag can be used only once.

Sorry if I totally missed the point of the question and this is not even close to an answer. :) I’m really tired.


txtstrap (Textpattern + Twitter Bootstrap + etc…)

Offline

#3 2010-05-20 22:20:28

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

Re: Need help making tagsoup ... ;)

RedFox wrote:

I want a list of articles (titles!) with content only belonging to ‘Gemengd 35+’.

I don’t really understand this. ‘Gemengd 35+’ is an article, how do other articles ‘belong’ to it?

Offline

#4 2010-05-21 06:10:47

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Re: Need help making tagsoup ... ;)

Hi Els and whaleen, thanks for joining in!

Go to this page to see what I’ve done so far.

The code:

<txp:if_individual_article>
<txp:article form="singlenolink" limit="1" time="any" />
</txp:else>
<txp:article limit="1" form="sticky" status="sticky" />
</txp:if_individual_article>
<txp:if_individual_article>
<h4>Wedstrijdverslagen:</h4>
<txp:article_custom section="competitie" category="gemengd35, heren35" form="excerpt_active" time="any" offset="" sort="position asc" />
</txp:if_individual_article>

But what I want is that the articles with cat ‘gemengd35’ (wedstrijdverslag 1; wedstrijdverslag 2) ONLY appear on the (individual) page ‘Gemengd 35+’. And the articles with cat ‘heren35’ (wedstrijdverslag 1; wedstrijdverslag 2) ONLY appear on the (individual) page ‘Heren 35+’. And so on!

Thanks for any help!

Last edited by RedFox (2010-05-21 06:11:13)

Offline

#5 2010-05-21 14:19:00

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

Re: Need help making tagsoup ... ;)

If you don’t mind changing your category names a little bit, like this:

  • gemengd35 -> gemengd-35
  • heren35 -> heren-35
  • etcetera

(so that they match your article url-title) you can do this:

<txp:if_individual_article>
<h4>Wedstrijdverslagen:</h4>
<txp:article_custom section="competitie" category='<txp:article_url_title />' form="excerpt_active" time="any" offset="" sort="position asc" />
</txp:if_individual_article>

Offline

#6 2010-05-21 19:19:10

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Re: Need help making tagsoup ... ;)

Wow … that’s elegant … :) … thank you!

But … what to do so the same list appears on the individual page of, let say, gemengd 35 + wedstrijdverslag 1?

It looks like it’s going to be (to) complex, Els! Maybe I have to make sections of ‘Gemengd 35+, Heren 35+, etc’ … what do you think?

Last edited by RedFox (2010-05-21 19:34:40)

Offline

#7 2010-05-21 20:02:31

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

Re: Need help making tagsoup ... ;)

RedFox wrote:

But … what to do so the same list appears on the individual page of, let say, gemengd 35 + wedstrijdverslag 1?

I can think of something, but I bet you’ll come up with yet another ‘what if’ ;) So can you tell me all the possible scenarios? Will it for example always be ‘article-title’ – wedstrijdverslag – ‘number’?

Maybe I have to make sections of ‘Gemengd 35+, Heren 35+, etc’ … what do you think?

No, I’m thinking of using one or more custom fields, or category 2 if that is not yet in use. But you need to consider who is going to maintain the site (I suppose that is not going to be you?), you’ll probably want to keep it as simple and automated as possible.

Offline

#8 2010-05-21 20:47:42

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Re: Need help making tagsoup ... ;)

It’s me going to maintain the site … not forever … so in both cases it has to be simple.

The titles of the articles (wedstrijdverslagen!) can be anything, e.g.: “4e overwinning op rij voor Gemengd 35+ team” … :0

Every team has an article published at ‘Competitie’, e.g. ‘Gemengd 35+’. The landing page of ‘Competitie’ has a ‘sticky’ and in the sidebar at the right a list of those team article titles.

Now there has to be a possibility to publish articles (wedstrijdverslagen!) for each team which are to be rendered as a list on each team article page. And the same list has to be published on each ‘wedstrijdverslag’ article page so you can navigate through those articles (of each team!).

It would be nice if the title of the ‘active’ article (wedstrijdverslagen) could be highlighted by CSS. And it would be nice when an article (wedstrijdverslag) of a particular team is rendered, e.g. “4e overwinning op rij voor Gemengd 35+ team”, the article title ‘Gemengd 35+’ in the sidebar at the right can be highlighted too!

That’s all … ;-)

Offline

#9 2010-05-22 02:14:42

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

Re: Need help making tagsoup ... ;)

In that case it’s simpler to use categories and <txp:related_articles />, no need for my article_url_title solution ;) If you create a category for each team, and make sure that all articles (including the main article) about for example Gemengd 35+ have ‘gemengd-35’ as category 1, you can do it like this:

<txp:if_individual_article>
<h4>Wedstrijdverslagen:</h4>
<txp:related_articles match="Category1" form="excerpt_active" sort="position asc" />
</txp:if_individual_article>

This will also list the main article on a ‘wedstrijdverslag’ page, don’t know if you want that. If you don’t, you can use category 2 to assign a category ‘wedstrijdverslagen’ and wrap the content of your form ‘excerpt_active’ in

<txp:if_article_category number="2" name="wedstrijdverslagen">
...
</txp:if_article_category>

It would be nice if the title of the ‘active’ article (wedstrijdverslagen) could be highlighted by CSS.

I don’t think the related_articles tag displays the current article, is that an acceptable alternative?

And it would be nice when an article (wedstrijdverslag) of a particular team is rendered, e.g. “4e overwinning op rij voor Gemengd 35+ team”, the article title ‘Gemengd 35+’ in the sidebar at the right can be highlighted too!

I’m sure it’s possible, but I need some sleep first ;) I’ll think about it tomorrow.

Offline

#10 2010-05-28 10:32:58

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Re: Need help making tagsoup ... ;)

OK … it’s up and running … :)

The code:

<txp:if_individual_article>
<div class="list">
<txp:related_articles match="Category2" form="teamarticles" sort="position asc" label="Meer artikelen over dit team:" labeltag="h3" break="" />
</div>
</txp:if_individual_article>

The form:

<h4><txp:permlink><txp:title /></txp:permlink></h4>

But … now the highlighting in the column at the right of the team (article!) when the individual related article(s) is rendered … !?

This is how the highlighting works when the sticky and the main article are being published:

The code:

<h4>Teams:</h4>
<txp:if_individual_article>
<txp:article_custom section="competitie" category="teams" form="excerptonlytitle_active" time="any" offset="" sort="position asc" />
<txp:else />
<txp:article_custom section="competitie" category="teams" form="excerptonlytitle" time="any" offset="" sort="position asc" />
</txp:if_individual_article>

The form (excerptonlytitle_active):

<txp:if_article_id>
<div class="article">
<h3><txp:permlink class="active"><txp:title /></txp:permlink></h3>
</div>
<txp:else />
<div class="article">
<h3><txp:permlink><txp:title /></txp:permlink></h3>
</div>
</txp:if_article_id>

Are you still there Els?

Last edited by RedFox (2010-05-28 10:35:14)

Offline

#11 2010-05-29 09:12:37

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

Re: Need help making tagsoup ... ;)

So your category 2 is the name of the team? Try this (form ‘excerptonlytitle_active’):

<txp:if_article_category number="2" name='<txp:category2 />'>
<div class="article">
<h3><txp:permlink class="active"><txp:title /></txp:permlink></h3>
</div>
<txp:else />
<div class="article">
<h3><txp:permlink><txp:title /></txp:permlink></h3>
</div>
</txp:if_article_category>

Offline

#12 2010-05-29 09:28:31

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 811
Website

Re: Need help making tagsoup ... ;)

Thanks Els. I’ll look into it after this weekend. I’m sure I’ll be back … ;-)

Offline

Board footer

Powered by FluxBB