Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#133 2008-04-22 11:02:59

mbravo
New Member
Registered: 2005-08-11
Posts: 8

Re: Widescreen, a photoblog template

After upgrading Textpattern to 4.0.6 the frontpage of my widescreen installation broke. Namely, it doesn’t show the link to previous photo in the navigation header. However, if you click through to archive and view the same photo form there, prev link works. If I turn on testing mode, I see an error at the top of the main page, like this:

Tag error: <txp:link_to_prev> -> Textpattern Notice: Article tags cannot be used outside an article context on line 1964

Any ideas what have changed between 4.0.5 and 4.0.6 that could have caused this, and how can I fix it?

The front page of the installation is here: http://podorogenarabotu.spb.ru/

Many thanks in advance for any insights.

Offline

#134 2008-04-22 22:20:21

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Widescreen, a photoblog template

I changed mine to use <txp:older> and <txp:newer> instead of <txp:link_to_prev> and <txp:link_to_next>


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#135 2008-04-23 06:05:50

mbravo
New Member
Registered: 2005-08-11
Posts: 8

Re: Widescreen, a photoblog template

MattD wrote:

I changed mine to use <txp:older> and <txp:newer> instead of <txp:link_to_prev> and <txp:link_to_next>

Matt,

I tried changing header-nav to txp:older/txp:newer – it then works beautifully on the front page, but if you click through to the archive page, next/prev icons stay grayed out always (you can check it out at the site, I left it in for the time being).I do not grasp the change of context between default and archive pages well enough yet to see why that happens.

Offline

#136 2008-04-23 18:04:02

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Widescreen, a photoblog template

Let’s see if I can explain this without confusing you (too much). The default section (your frontpage) is always an article list. Even if you only allow one article to show it is still an article list of one.

When you select an article from your archive you are now viewing an individual article.

Keeping the above in mind, for article list views you need to use the <txp:newer> and <txp:older> tags but for individual article views you need to use the <txp:link_to_next> and <txp:link_to_previous> tags.

I believe you are using a single form template for your top navigation so what you need to do is surround those links with a conditional like so:-

<txp:if_individual_article>
<txp:link_to_next>Next</txp:link_to_next>
<txp:link_to_previous>Previous</txp:link_to_previous>
<txp:else />
<txp:newer>Next</txp:newer>
<txp:older>Previous</txp:older>
</txp:if_individual_article>

or something similar to that to get the exact effect that you need.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#137 2008-04-23 18:59:23

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: Widescreen, a photoblog template

Should be <txp:link_to_prev>Previous</txp:link_to_prev> though.

Here is the relevent portion of the header-nav form

<li id="n-previous">
<txp:if_individual_article>
<txp:link_to_prev>Previous</txp:link_to_prev>
<txp:else />
<txp:older>Previous</txp:older>
</txp:if_individual_article>
</li>
<li id="n-next">
<txp:if_individual_article>
<txp:link_to_next>Next</txp:link_to_next>
<txp:else />
<txp:newer>Next</txp:newer>
</txp:if_individual_article>
</li>

Last edited by MattD (2009-07-28 17:39:30)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#138 2008-04-23 19:18:58

mbravo
New Member
Registered: 2005-08-11
Posts: 8

Re: Widescreen, a photoblog template

Thanks a lot! Thebombsite gave the perfect explanation and Matt then quoted the relevant portion of code so I didn’t even have to type anything :)

And everything now works as intended, plus I learned a few things about Textpattern.

Offline

#139 2008-08-19 12:00:34

infrarosso
New Member
Registered: 2007-10-15
Posts: 6

Re: Widescreen, a photoblog template

hi all! First of all thx for the great template. Then i have made an italian version of this and i’d like to share. Can anybody tell me how to do? i’m a bit noooob! ;)

Giovanni

Offline

Board footer

Powered by FluxBB